Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

Get Template Version

get_template_version

Retrieve details of a specific template version by providing the template ID and version ID.

Instructions

Retrieve details of a specific template version

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
template_idYesID of the template
version_idYesID of the version to retrieve

Implementation Reference

  • The handler function for get_template_version. It makes a GET request to the SendGrid API endpoint /v3/templates/{template_id}/versions/{version_id} and returns the result.
      handler: async ({ template_id, version_id }: { template_id: string; version_id: string }): Promise<ToolResult> => {
        const result = await makeRequest(`https://api.sendgrid.com/v3/templates/${template_id}/versions/${version_id}`);
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      },
    },
  • The config/schema definition for get_template_version, specifying inputSchema with template_id and version_id as required string parameters.
    config: {
      title: "Get Template Version",
      description: "Retrieve details of a specific template version",
      inputSchema: {
        template_id: z.string().describe("ID of the template"),
        version_id: z.string().describe("ID of the version to retrieve"),
      },
    },
  • src/index.ts:20-23 (registration)
    Tools are registered with the MCP server using server.registerTool(). The get_template_version tool is included in allTools and gets registered here by its name.
    // Register all tools
    for (const [name, tool] of Object.entries(allTools)) {
      server.registerTool(name, tool.config as any, tool.handler as any);
    }
  • The templateTools object (which includes get_template_version) is exported from templates.ts and spread into the combined allTools export.
    import { templateTools } from "./templates.js";
    
    export const allTools = {
      ...automationTools,
      ...campaignTools,
      ...contactTools,
      ...mailTools,
      ...miscTools,
      ...statsTools,
      ...templateTools,
    };
  • The makeRequest helper used by the get_template_version handler to make authenticated HTTP requests to the SendGrid API.
    export async function makeRequest(url: string, options: RequestInit = {}): Promise<any> {
      const response = await fetch(url, {
        headers: {
          ...getAuthHeaders(),
          ...options.headers,
        },
        ...options,
      });
    
      if (!response.ok) {
        const errorText = await response.text();
        throw new Error(`SendGrid API error (${response.status}): ${errorText}`);
      }
    
      return response.json();
    }
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. The brief description does not mention important aspects such as return format, permissions, or whether the operation is safe (read-only). This lack of detail leaves the agent guessing.

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

Conciseness4/5

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

The description is a single concise sentence with no waste. However, it could be slightly more informative without sacrificing conciseness, such as hinting at the output or distinguishing from similar tools.

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?

The tool has 2 simple parameters and no output schema, so the description is the only source for understanding what 'details' are returned. It does not clarify if the output includes content, metadata, or both, leaving the agent uncertain about the response structure.

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?

The input schema provides full descriptions for both parameters (template_id and version_id), achieving 100% coverage. The description adds no additional meaning beyond the schema, so the baseline score of 3 is appropriate.

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

Purpose4/5

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

The description clearly states the verb 'retrieve' and the resource 'details of a specific template version', making the purpose clear. However, it does not explicitly distinguish this from the sibling tool 'get_template', which retrieves a template itself, not a version.

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?

The description provides no guidance on when to use this tool versus alternatives like 'get_template' or 'list_templates'. Given the siblings, explicit usage context would help the agent choose correctly.

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/deyikong/sendgrid-mcp'

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