feat: add audience and campaign tools#17
Conversation
Audiences (7 tools): - get_audiences, get_audience, delete_audience - get_audience_members, search_audience_members - add_audience_members, delete_audience_members Campaigns (6 tools): - create_campaign, get_campaign, start_campaign - pause_campaign, delete_campaign, export_campaign_logs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
EntelligenceAI PR SummaryThis PR adds 13 new MCP tools across Audience and Campaign management domains, and reorganizes the tool registry into structured sections.
Confidence Score: 2/5 - Changes NeededNot safe to merge — while this PR successfully adds 13 new MCP tools across Audience and Campaign management domains with a clean registry reorganization, there is a confirmed logic bug in Key Findings:
Files requiring special attention
|
There was a problem hiding this comment.
This PR adds 13 new MCP tools across Audience and Campaign management domains, and reorganizes the tool registry into structured sections.
- Audience tools:
get_audiences,get_audience,delete_audience,get_audience_members(with a knownpage_size→offsetmapping bug),search_audience_members,add_audience_members,delete_audience_members - Campaign tools:
get_campaign,create_campaign,start_campaign,pause_campaign,delete_campaign,export_campaign_logs - All tools use Zod schema validation for inputs and
formatApiErrorfor error responses src/tools/index.tsreorganized into 'Audiences', 'Campaigns', and 'Calls' sections
| const queryParts: string[] = []; | ||
| if (params.page !== undefined) queryParts.push(`page=${params.page}`); | ||
| if (params.page_size !== undefined) queryParts.push(`offset=${params.page_size}`); | ||
| const query = queryParts.length > 0 ? `?${queryParts.join("&")}` : ""; |
There was a problem hiding this comment.
Correctness: page_size is serialized as offset= instead of page_size=, so the API will receive a record-offset value where it expects a page size, silently returning wrong pagination results.
🤖 AI Agent Prompt for Cursor/Windsurf
📋 Copy this prompt to your AI coding assistant (Cursor, Windsurf, etc.) to get help fixing this issue
In src/tools/get-audience-members.ts at line 22, the query parameter name is wrong. Change `offset=${params.page_size}` to `page_size=${params.page_size}` so the API receives the correct parameter name for page size instead of an offset value.
Summary
Total tools: 71 (up from 58)
Note:
create_audienceis not included because it requires CSV file upload (multipart form data) which MCP can't do. Users can create audiences in the console and useadd_audience_membersto manage contacts.Test plan
npm run build)🤖 Generated with Claude Code