Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

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
NameRequiredDescriptionDefault
campaign_idYesThe campaign ID

Implementation Reference

  • 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), }, ], };
  • 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"], }, },
  • 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}`); }
  • 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), }; });

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