Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

list_automation_subscribers

Retrieve subscribers currently in a Mailchimp automation email queue by specifying workflow and email IDs.

Instructions

List subscribers in an automation email queue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idYesThe workflow ID of the automation
email_idYesThe email ID within the automation

Implementation Reference

  • Core handler function that executes the tool logic by making a paginated request to the Mailchimp API endpoint for listing subscribers in an automation email queue.
    async listAutomationSubscribers( workflowId: string, emailId: string ): Promise<{ subscribers: MailchimpAutomationSubscriber[] }> { return await this.makePaginatedRequest( `/automations/${workflowId}/emails/${emailId}/queue`, "timestamp_signup", "DESC" ); }
  • Tool definition including input schema for validating workflow_id and email_id parameters.
    name: "list_automation_subscribers", description: "List subscribers in an automation email queue", inputSchema: { type: "object", properties: { workflow_id: { type: "string", description: "The workflow ID of the automation", }, email_id: { type: "string", description: "The email ID within the automation", }, }, required: ["workflow_id", "email_id"], },
  • Dispatch handler in handleToolCall that invokes the service method and formats the response for MCP.
    case "list_automation_subscribers": const subscribers = await service.listAutomationSubscribers( args.workflow_id, args.email_id ); return { content: [ { type: "text", text: JSON.stringify( subscribers.subscribers.map((s) => ({ email_address: s.email_address, status: s.status, merge_fields: s.merge_fields, })), null, 2 ), }, ], };
  • src/index.ts:42-46 (registration)
    Registers the tool by providing getToolDefinitions in the MCP server's list tools handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: getToolDefinitions(mailchimpService), }; });
  • TypeScript interface defining the structure of automation subscriber data returned by the tool.
    export interface MailchimpAutomationSubscriber { id: string; email_address: string; unique_email_id: string; email_type: string; status: | "subscribed" | "unsubscribed" | "cleaned" | "pending" | "transactional"; merge_fields: Record<string, any>; interests: Record<string, boolean>; stats: { avg_open_rate: number; avg_click_rate: number; ecommerce_data?: { total_revenue: number; number_of_orders: number; currency_code: string; }; }; ip_signup?: string; timestamp_signup?: string; ip_opt?: string; timestamp_opt?: string; member_rating: number; last_changed: string; language?: string; vip: boolean; email_client?: string; location?: { latitude: number; longitude: number; gmtoff: number; dstoff: number; country_code: string; timezone: string; region: string; }; source?: string; tags_count: number; tags: Array<{ id: number; name: string; }>; list_id: string; _links?: Array<{ rel: string; href: string; method: string; targetSchema?: string; schema?: string; }>; }

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