list_audiences
Retrieve all Mailchimp audiences to obtain list IDs required for creating email campaigns.
Instructions
List all Mailchimp audiences/lists. Returns list IDs needed for campaign creation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Number of results to return (default 10, max 1000) |
Implementation Reference
- server.js:23-41 (handler)The definition and handler implementation for the list_audiences tool. It uses mailchimp.lists.getAllLists to retrieve audience data and formats it for the MCP response.
server.tool( "list_audiences", "List all Mailchimp audiences/lists. Returns list IDs needed for campaign creation.", { count: z.number().optional().describe("Number of results to return (default 10, max 1000)"), }, async ({ count }) => { const response = await mailchimp.lists.getAllLists({ count: count || 10 }); const lists = response.lists.map((l) => ({ id: l.id, name: l.name, member_count: l.stats.member_count, unsubscribe_count: l.stats.unsubscribe_count, open_rate: l.stats.open_rate, click_rate: l.stats.click_rate, })); return { content: [{ type: "text", text: JSON.stringify(lists, null, 2) }] }; } );