list_lists
Retrieve all email lists from your Mailchimp account to manage automation recipients and audience segments.
Instructions
List all lists in your Mailchimp account (for automation recipients)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.ts:651-669 (handler)The handler function for the 'list_lists' tool within the handleToolCall switch statement. It calls the service's listLists method and formats a JSON response with key list details.case "list_lists": const lists = await service.listLists(); return { content: [ { type: "text", text: JSON.stringify( lists.lists.map((l) => ({ id: l.id, name: l.name, member_count: l.stats.member_count, date_created: l.date_created, })), null, 2 ), }, ], };
- src/tools/index.ts:95-104 (registration)Tool registration in the getToolDefinitions array, including name, description, and empty input schema (no parameters required).{ name: "list_lists", description: "List all lists in your Mailchimp account (for automation recipients)", inputSchema: { type: "object", properties: {}, required: [], }, },
- src/services/mailchimp.ts:155-157 (helper)Helper method in MailchimpService that fetches the paginated list of Mailchimp lists from the API endpoint '/lists'.async listLists(): Promise<{ lists: MailchimpList[] }> { return await this.makePaginatedRequest("/lists", "date_created", "DESC"); }
- src/types/index.ts:329-387 (schema)TypeScript interface defining the structure of a MailchimpList object, used in the return type of listLists() and mapped in the handler response.export interface MailchimpList { id: string; name: string; contact: { company: string; address1: string; address2: string; city: string; state: string; zip: string; country: string; phone: string; }; permission_reminder: string; use_archive_bar: boolean; campaign_defaults: { from_name: string; from_email: string; subject: string; language: string; }; notify_on_subscribe: string; notify_on_unsubscribe: string; date_created: string; list_rating: number; email_type_option: boolean; subscribe_url_short: string; subscribe_url_long: string; beamer_address: string; visibility: string; double_optin: boolean; marketing_permissions: boolean; modules: string[]; stats: { member_count: number; unsubscribe_count: number; cleaned_count: number; member_count_since_send: number; unsubscribe_count_since_send: number; cleaned_count_since_send: number; campaign_count: number; campaign_last_sent: string; merge_field_count: number; avg_sub_rate: number; avg_unsub_rate: number; target_sub_rate: number; open_rate: number; click_rate: number; last_sub_date: string; last_unsub_date: string; }; _links?: Array<{ rel: string; href: string; method: string; targetSchema?: string; schema?: string; }>; }