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
| Name | Required | Description | Default |
|---|---|---|---|
| template_id | Yes | ID of the template | |
| version_id | Yes | ID of the version to delete |
Implementation Reference
- src/tools/templates.ts:278-288 (handler)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.` }] }; },
- src/tools/templates.ts:270-277 (schema)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); }
- src/tools/index.ts:9-16 (registration)Aggregation of all tool objects, spreading templateTools which includes delete_template_version.export const allTools = { ...automationTools, ...campaignTools, ...contactTools, ...mailTools, ...miscTools, ...statsTools, ...templateTools,