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
| Name | Required | Description | Default |
|---|---|---|---|
| workflow_id | Yes | The workflow ID of the automation | |
| email_id | Yes | The email ID within the automation |
Implementation Reference
- src/services/mailchimp.ts:131-140 (handler)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" ); }
- src/tools/index.ts:60-75 (schema)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"], },
- src/tools/index.ts:615-635 (handler)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), }; });
- src/types/index.ts:217-271 (schema)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; }>; }