Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

get_template

Retrieve template details and versions from SendGrid to manage email content and ensure consistent messaging across campaigns.

Instructions

Retrieve details of a specific template including all versions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
template_idYesID of the template to retrieve

Implementation Reference

  • The handler function executes the tool logic by making an API request to SendGrid to fetch details of the specified template ID and returns the result as formatted JSON text.
    handler: async ({ template_id }: { template_id: string }): Promise<ToolResult> => { const result = await makeRequest(`https://api.sendgrid.com/v3/templates/${template_id}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; },
  • The tool configuration including title, description, and Zod input schema for validating the template_id parameter.
    config: { title: "Get Template Details", description: "Retrieve details of a specific template including all versions", inputSchema: { template_id: z.string().describe("ID of the template to retrieve"), }, },
  • src/index.ts:21-23 (registration)
    The MCP server registration loop that registers the get_template tool (along with all others) by calling server.registerTool with its name, config, and handler.
    for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }
  • Spreading templateTools into allTools object, which includes the get_template tool definition.
    ...templateTools,

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