get_template
Retrieve details of a specific email template from Mailchimp using its template ID to access design and content information.
Instructions
Get details of a specific template
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template_id | Yes | The template ID |
Implementation Reference
- src/tools/index.ts:848-857 (handler)Handler function for the 'get_template' tool call. It invokes the Mailchimp service's getTemplate method with the provided template_id and returns the result as a JSON-formatted text content block.case "get_template": const template = await service.getTemplate(args.template_id); return { content: [ { type: "text", text: JSON.stringify(template, null, 2), }, ], };
- src/tools/index.ts:273-286 (schema)Tool definition including name, description, and input schema requiring a numeric 'template_id'.{ name: "get_template", description: "Get details of a specific template", inputSchema: { type: "object", properties: { template_id: { type: "number", description: "The template ID", }, }, required: ["template_id"], }, },
- src/index.ts:42-46 (registration)Registration of the tool list handler, which provides all tool definitions including 'get_template' via getToolDefinitions.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: getToolDefinitions(mailchimpService), }; });
- src/services/mailchimp.ts:240-242 (helper)MailchimpService helper method that performs the actual API request to retrieve a template by ID.async getTemplate(templateId: number): Promise<MailchimpTemplate> { return await this.makeRequest(`/templates/${templateId}`); }
- src/types/index.ts:509-529 (schema)TypeScript interface defining the structure of a MailchimpTemplate, used as the return type for getTemplate.export interface MailchimpTemplate { id: number; type: "user" | "base" | "gallery"; name: string; drag_and_drop: boolean; responsive: boolean; category?: string; date_created: string; created_by: string; active: boolean; folder_id?: string; thumbnail?: string; share_url?: string; _links?: Array<{ rel: string; href: string; method: string; targetSchema?: string; schema?: string; }>; }