Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

get_template_version

Retrieve specific template version details from SendGrid to access email template content, structure, and configuration for email marketing and transactional campaigns.

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 async handler function that executes the tool logic by making a GET request to the SendGrid API to retrieve details of a specific template version.
    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) }] }; },
  • Zod input schema defining the required parameters: template_id and version_id.
    inputSchema: { template_id: z.string().describe("ID of the template"), version_id: z.string().describe("ID of the version to retrieve"), },
  • The tool definition and registration within the templateTools object, including config (with schema) and handler.
    get_template_version: { 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"), }, }, 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) }] }; }, },
  • Import of templateTools and inclusion into allTools object, which is then registered in MCP server.
    import { templateTools } from "./templates.js"; export const allTools = { ...automationTools, ...campaignTools, ...contactTools, ...mailTools, ...miscTools, ...statsTools, ...templateTools,
  • src/index.ts:20-23 (registration)
    MCP server registration loop that registers all tools from allTools, including get_template_version.
    // Register all tools for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }

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