list_campaigns
Retrieve all email campaigns from your Mailchimp account to review marketing activities and analyze performance data.
Instructions
List all campaigns in your Mailchimp account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.ts:723-742 (handler)Executes the 'list_campaigns' tool by calling the Mailchimp service method and formatting the campaigns list into a JSON text response with key fields: id, type, status, create_time, send_time.case "list_campaigns": const campaigns = await service.listCampaigns(); return { content: [ { type: "text", text: JSON.stringify( campaigns.campaigns.map((c) => ({ id: c.id, type: c.type, status: c.status, create_time: c.create_time, send_time: c.send_time, })), null, 2 ), }, ], };
- src/tools/index.ts:175-182 (schema)Defines the tool metadata including name, description, and input schema (empty object, no required properties).name: "list_campaigns", description: "List all campaigns in your Mailchimp account", inputSchema: { type: "object", properties: {}, required: [], }, },
- src/index.ts:42-46 (registration)MCP server registration for the 'listTools' request handler, which returns all tool definitions (including 'list_campaigns') via getToolDefinitions.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: getToolDefinitions(mailchimpService), }; });
- src/services/mailchimp.ts:189-191 (helper)Service helper method in MailchimpService that performs a paginated API request to fetch campaigns, sorted by creation time descending.async listCampaigns(): Promise<{ campaigns: MailchimpCampaign[] }> { return await this.makePaginatedRequest("/campaigns", "create_time", "DESC"); }