Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

list_campaigns

Retrieve all email marketing campaigns from your Mailchimp account to monitor performance and analyze outreach efforts.

Instructions

List all campaigns in your Mailchimp account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'list_campaigns' tool call. Invokes the Mailchimp service to list campaigns, maps key fields (id, type, status, create_time, send_time), and returns a formatted text response with JSON.
    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 ), }, ], };
  • Tool registration/definition in getToolDefinitions array, including name, description, and empty inputSchema (no parameters required).
    { name: "list_campaigns", description: "List all campaigns in your Mailchimp account", inputSchema: { type: "object", properties: {}, required: [], }, },
  • TypeScript interface defining the structure of a MailchimpCampaign object, used in the response type of listCampaigns.
    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; }>; }
  • Core service method that performs a paginated API request to Mailchimp's /campaigns endpoint to fetch campaigns, sorted by create_time DESC.
    async listCampaigns(): Promise<{ campaigns: MailchimpCampaign[] }> { return await this.makePaginatedRequest("/campaigns", "create_time", "DESC"); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AgentX-ai/mailchimp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server