list_templates
Retrieve all email templates from your Mailchimp account for use in marketing campaigns.
Instructions
List all templates in your Mailchimp account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.ts:825-846 (handler)The main handler for the 'list_templates' tool in the handleToolCall switch statement. It calls the Mailchimp service's listTemplates method and formats the result as MCP-compatible content with a JSON string of template summaries.case "list_templates": const templates = await service.listTemplates(); return { content: [ { type: "text", text: JSON.stringify( templates.templates.map((t) => ({ id: t.id, name: t.name, type: t.type, drag_and_drop: t.drag_and_drop, responsive: t.responsive, active: t.active, date_created: t.date_created, })), null, 2 ), }, ], };
- src/tools/index.ts:264-272 (registration)Tool registration entry in the tools array, defining the name, description, and input schema (no parameters required).{ name: "list_templates", description: "List all templates in your Mailchimp account", inputSchema: { type: "object", properties: {}, required: [], }, },
- src/tools/index.ts:267-271 (schema)Input schema for the 'list_templates' tool, specifying an empty object with no required properties.inputSchema: { type: "object", properties: {}, required: [], },
- src/services/mailchimp.ts:232-238 (helper)Helper method in MailchimpService that performs the actual API request to fetch the list of templates using a paginated endpoint.async listTemplates(): Promise<{ templates: MailchimpTemplate[] }> { return await this.makePaginatedRequest( "/templates", "date_created", "DESC" ); }