get_campaign
Retrieve detailed information about a specific Mailchimp email campaign using its unique ID to analyze performance metrics 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 call. It invokes the Mailchimp service to fetch the campaign by ID and returns the result as a JSON-formatted text content block.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 input schema definition for the 'get_campaign' tool, specifying that a 'campaign_id' string parameter is required.{ 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 helper method in MailchimpService that performs the actual API request to retrieve campaign details using the Mailchimp API endpoint `/campaigns/{campaignId}`.async getCampaign(campaignId: string): Promise<MailchimpCampaign> { return await this.makeRequest(`/campaigns/${campaignId}`); }
- src/types/index.ts:390-422 (schema)TypeScript interface defining the structure of a Mailchimp campaign object, used as the return type for getCampaign.export interface MailchimpCampaign { id: string; type: "regular" | "plaintext" | "absplit" | "rss" | "variate"; status: "save" | "paused" | "schedule" | "sending" | "sent"; create_time: string; send_time?: string; archive_url?: string; long_archive_url?: string; authenticate: boolean; ecommerce?: { store_id: string; product_id: string; product_variant_id: string; order_id: string; }; auto_tweet: boolean; auto_footer: boolean; inline_css: boolean; auto_tweet_text?: string; auto_footer_text?: string; auto_footer_link?: string; fb_comments: boolean; timewarp: boolean; template_id?: number; drag_and_drop: boolean; _links?: Array<{ rel: string; href: string; method: string; targetSchema?: string; schema?: string; }>; }
- src/index.ts:42-46 (registration)MCP server registration for listing tools, which includes 'get_campaign' via getToolDefinitions.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: getToolDefinitions(mailchimpService), }; });