Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

Update Template

update_template

Modify the name of an existing email template in SendGrid to reflect content changes or organizational updates.

Instructions

Update the name of an existing template

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
template_idYesID of the template to update
nameYesNew name for the template

Implementation Reference

  • The handler function that checks for read-only mode and sends a PATCH request to the SendGrid API to update the template name.
    handler: async ({ template_id, name }: { template_id: string; name: 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}`, {
        method: "PATCH",
        body: JSON.stringify({ name }),
      });
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    },
  • Tool configuration including title, description, and Zod input schema defining the required parameters: template_id and name.
    config: {
      title: "Update Template",
      description: "Update the name of an existing template",
      inputSchema: {
        template_id: z.string().describe("ID of the template to update"),
        name: z.string().describe("New name for the template"),
      },
    },
  • The complete tool definition and registration within the exported templateTools object.
    update_template: {
      config: {
        title: "Update Template",
        description: "Update the name of an existing template",
        inputSchema: {
          template_id: z.string().describe("ID of the template to update"),
          name: z.string().describe("New name for the template"),
        },
      },
      handler: async ({ template_id, name }: { template_id: string; name: 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}`, {
          method: "PATCH",
          body: JSON.stringify({ name }),
        });
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      },
    },
  • Import of templateTools and spreading into the allTools export, aggregating all tools for higher-level registration.
    import { templateTools } from "./templates.js";
    
    export const allTools = {
      ...automationTools,
      ...campaignTools,
      ...contactTools,
      ...mailTools,
      ...miscTools,
      ...statsTools,
      ...templateTools,
    };
  • src/index.ts:21-23 (registration)
    Loop that registers every tool from allTools with the MCP server using registerTool.
    for (const [name, tool] of Object.entries(allTools)) {
      server.registerTool(name, tool.config as any, tool.handler as any);
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states this is an update operation, implying mutation, but doesn't disclose behavioral traits like permission requirements, whether changes are reversible, error handling, or rate limits. This is inadequate for a mutation tool with zero annotation coverage.

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, efficient sentence with zero waste. It's front-loaded and appropriately sized for the tool's purpose, making it easy to parse quickly.

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?

Given this is a mutation tool with no annotations and no output schema, the description is incomplete. It lacks behavioral context (e.g., side effects, permissions), usage guidelines, and details on what the tool returns, leaving significant gaps for an AI agent to understand its full operation.

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%, so the schema fully documents both parameters. The description adds no additional meaning beyond what the schema provides (e.g., no examples, constraints, or context for the parameters), resulting in the baseline score of 3.

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 verb ('update') and resource ('existing template'), specifying that it modifies the name. However, it doesn't explicitly differentiate from sibling tools like 'update_template_version' or 'update_contact', which have similar update operations on different resources.

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. The description doesn't mention prerequisites (e.g., needing an existing template ID), exclusions, or comparisons to related tools like 'create_template' or 'delete_template'.

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