Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

Delete Template Version

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.

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 checks read-only mode and sends a DELETE request to the 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.` }] };
    },
  • Zod input schema defining the required template_id and version_id parameters.
    inputSchema: {
      template_id: z.string().describe("ID of the template"),
      version_id: z.string().describe("ID of the version to delete"),
    },
  • The tool definition object added to templateTools export, which registers the tool.
    delete_template_version: {
      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"),
        },
      },
      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.` }] };
      },
    },
  • Import of templateTools and inclusion via spread operator into allTools, the central tools registry.
    import { templateTools } from "./templates.js";
    
    export const allTools = {
      ...automationTools,
      ...campaignTools,
      ...contactTools,
      ...mailTools,
      ...miscTools,
      ...statsTools,
      ...templateTools,
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action is a deletion, implying a destructive operation, but does not cover critical aspects like permissions required, irreversibility, effects on related data (e.g., other versions or usage), or error handling. This leaves significant gaps for a mutation tool.

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

Conciseness5/5

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

The description is a single, direct sentence with no unnecessary words, making it highly concise and front-loaded. It efficiently communicates the core purpose without redundancy or fluff.

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?

For a destructive tool with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits (e.g., confirmation, side effects), expected outcomes, or error cases, leaving the agent with incomplete context for safe and effective use.

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?

Schema description coverage is 100%, with clear descriptions for 'template_id' and 'version_id'. The description does not add any meaning beyond the schema, such as format examples or interdependencies. Baseline 3 is appropriate as the schema adequately documents parameters.

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 action ('Delete') and target ('a specific version of a template'), which is specific and unambiguous. However, it does not differentiate from sibling tools like 'delete_template' (which likely deletes entire templates rather than versions), missing full distinction.

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?

No guidance is provided on when to use this tool versus alternatives such as 'delete_template' or 'update_template_version'. The description lacks context about prerequisites, consequences, or typical scenarios for deletion, offering minimal usage direction.

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