Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

delete_template_version

Remove a specific version of an email template from SendGrid by providing the template ID and version ID to manage template revisions and maintain clean template libraries.

Instructions

Delete a specific version of a template

Input Schema

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

Implementation Reference

  • The main handler function that implements the tool logic: checks read-only mode and sends DELETE request to SendGrid API to delete the specified template version.
    handler: async ({ template_id, version_id }: { template_id: string; version_id: string }): Promise<ToolResult> => { const readOnlyCheck = checkReadOnlyMode(); if (readOnlyCheck.blocked) { return { content: [{ type: "text", text: readOnlyCheck.message! }] }; } const result = await makeRequest(`https://api.sendgrid.com/v3/templates/${template_id}/versions/${version_id}`, { method: "DELETE", }); return { content: [{ type: "text", text: `Template version ${version_id} deleted successfully.` }] }; },
  • Tool configuration including Zod input schema defining required template_id and version_id parameters.
    config: { title: "Delete Template Version", description: "Delete a specific version of a template", inputSchema: { template_id: z.string().describe("ID of the template"), version_id: z.string().describe("ID of the version to delete"), }, },
  • src/index.ts:21-23 (registration)
    MCP server registration loop that registers all tools (including delete_template_version from allTools) with their config and handler.
    for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }
  • Aggregation of all tool objects, spreading templateTools which includes delete_template_version.
    export const allTools = { ...automationTools, ...campaignTools, ...contactTools, ...mailTools, ...miscTools, ...statsTools, ...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