Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

get_template

Retrieve detailed information about a specific Mailchimp email template by providing its template ID for email marketing management.

Instructions

Get details of a specific template

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
template_idYesThe template ID

Implementation Reference

  • The core handler function that executes the tool logic by making an API request to retrieve the specific Mailchimp template using the provided template ID.
    async getTemplate(templateId: number): Promise<MailchimpTemplate> {
      return await this.makeRequest(`/templates/${templateId}`);
    }
  • The MCP tool dispatch handler case for 'get_template' that invokes the service method and formats the JSON response as MCP content.
    case "get_template":
      const template = await service.getTemplate(args.template_id);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(template, null, 2),
          },
        ],
      };
  • The input schema and metadata definition for the 'get_template' tool, including name, description, and required template_id parameter.
    {
      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:52-74 (registration)
    MCP server registration of the CallToolRequest handler that routes tool calls (including get_template) to the handleToolCall function.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        return await handleToolCall(
          mailchimpService,
          request.params.name,
          request.params.arguments
        );
      } catch (error: any) {
        console.error("Mailchimp Error:", error);
    
        // Handle Mailchimp API errors
        if (error.message && error.message.includes("Mailchimp API Error:")) {
          throw new McpError(ErrorCode.InternalError, error.message);
        }
    
        // Handle other errors
        if (error instanceof Error) {
          throw new McpError(ErrorCode.InternalError, error.message);
        }
    
        throw new McpError(ErrorCode.InternalError, "An unexpected error occurred");
      }
    });
  • TypeScript interface defining the structure of a MailchimpTemplate, used for type safety in the tool's return value.
    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;
      }>;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states 'Get details' which implies a read-only operation, but doesn't disclose behavioral traits like authentication needs, rate limits, error handling, or what happens if the template doesn't exist. This is inadequate for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded and appropriately sized for a simple retrieval tool, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 parameter, 100% schema coverage) but lack of annotations and output schema, the description is incomplete. It doesn't explain what 'details' are returned, potential errors, or usage context, which is insufficient for effective tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'template_id' fully documented in the schema. The description doesn't add any meaning beyond what the schema provides, such as format examples or context for the ID. Baseline 3 is appropriate since the schema handles the parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get details of a specific template' clearly states the verb ('Get') and resource ('template'), but it's vague about what 'details' entails and doesn't distinguish this from sibling tools like 'list_templates' or other 'get_' tools. It avoids tautology but lacks specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as 'list_templates' or other retrieval tools. The description implies usage for a specific template but doesn't mention prerequisites or exclusions, leaving the agent to infer context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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