list_members
Retrieve subscribers from a Mailchimp audience to sync contacts or audit membership status with filtering and pagination options.
Instructions
List members/subscribers in a Mailchimp audience. Use for syncing or auditing contacts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | Audience/list ID | |
| count | No | Number of results (default 100, max 1000) | |
| offset | No | Offset for pagination (default 0) | |
| status | No | Filter by status: subscribed, unsubscribed, cleaned, pending, transactional |
Implementation Reference
- server.js:303-325 (handler)The tool "list_members" is defined using server.tool, and its handler function performs the Mailchimp API call to list members, processes the response to extract relevant contact details, and returns them as a structured MCP response.
server.tool( "list_members", "List members/subscribers in a Mailchimp audience. Use for syncing or auditing contacts.", { list_id: z.string().describe("Audience/list ID"), count: z.number().optional().describe("Number of results (default 100, max 1000)"), offset: z.number().optional().describe("Offset for pagination (default 0)"), status: z.string().optional().describe("Filter by status: subscribed, unsubscribed, cleaned, pending, transactional"), }, async ({ list_id, count, offset, status }) => { const opts = { count: count || 100, offset: offset || 0 }; if (status) opts.status = status; const response = await mailchimp.lists.getListMembersInfo(list_id, opts); const members = response.members.map((m) => ({ email: m.email_address, first_name: m.merge_fields.FNAME || "", last_name: m.merge_fields.LNAME || "", status: m.status, tags: m.tags.map((t) => t.name), })); return { content: [ {