Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

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
NameRequiredDescriptionDefault
template_idYesThe template ID

Implementation Reference

  • 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), }, ], };
  • 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), }; });
  • 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}`); }
  • 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; }>; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AgentX-ai/mailchimp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server