get_campaign
Retrieve specific campaign details from Mailchimp to analyze email marketing performance and content.
Instructions
Get details of a specific campaign
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| campaign_id | Yes | The campaign ID |
Implementation Reference
- src/tools/index.ts:744-753 (handler)The handler function for the 'get_campaign' tool in handleToolCall. It invokes service.getCampaign with the provided campaign_id and returns the result as a JSON-formatted text response.case "get_campaign": const campaign = await service.getCampaign(args.campaign_id); return { content: [ { type: "text", text: JSON.stringify(campaign, null, 2), }, ], };
- src/tools/index.ts:183-196 (schema)The tool definition in getToolDefinitions, including name, description, and input schema that requires a 'campaign_id' string.{ name: "get_campaign", description: "Get details of a specific campaign", inputSchema: { type: "object", properties: { campaign_id: { type: "string", description: "The campaign ID", }, }, required: ["campaign_id"], }, },
- src/services/mailchimp.ts:193-195 (helper)The MailchimpService helper method getCampaign that makes an API request to retrieve campaign details from Mailchimp's /campaigns/{campaignId} endpoint.async getCampaign(campaignId: string): Promise<MailchimpCampaign> { return await this.makeRequest(`/campaigns/${campaignId}`); }