list_members
Retrieve all subscribers from a Mailchimp email list by providing the list ID to manage and analyze your audience data.
Instructions
List all members in a specific list
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | The list ID |
Implementation Reference
- src/tools/index.ts:756-775 (handler)Handler for the 'list_members' tool call: extracts list_id from args, calls service.listMembers, maps members to summary fields, and returns formatted JSON text response.case "list_members": const members = await service.listMembers(args.list_id); return { content: [ { type: "text", text: JSON.stringify( members.members.map((m) => ({ id: m.id, email_address: m.email_address, status: m.status, member_rating: m.member_rating, last_changed: m.last_changed, })), null, 2 ), }, ], };
- src/tools/index.ts:198-210 (schema)Tool schema definition for 'list_members': defines name, description, and input schema requiring 'list_id' string.{ name: "list_members", description: "List all members in a specific list", inputSchema: { type: "object", properties: { list_id: { type: "string", description: "The list ID", }, }, required: ["list_id"], },
- src/services/mailchimp.ts:198-204 (helper)Helper method in MailchimpService that implements listMembers by making a paginated API request to Mailchimp's /lists/{listId}/members endpoint.async listMembers(listId: string): Promise<{ members: MailchimpMember[] }> { return await this.makePaginatedRequest( `/lists/${listId}/members`, "timestamp_signup", "DESC" ); }