Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

Create New Template

create_template

Create dynamic transactional email templates in SendGrid to automate personalized communications and streamline email workflows.

Instructions

Create a new dynamic transactional template

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the template
generationNoTemplate generation typedynamic

Implementation Reference

  • The async handler function that implements the core logic of the 'create_template' tool. It performs a read-only mode check, then sends a POST request to the SendGrid API to create a new template with the provided name and optional generation type.
    handler: async ({ name, generation }: { name: string; generation?: 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", {
        method: "POST",
        body: JSON.stringify({
          name,
          generation: generation || "dynamic"
        }),
      });
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    },
  • The tool configuration including title, description, and Zod input schema defining the parameters: required 'name' (string) and optional 'generation' (enum: legacy or dynamic, defaults to dynamic).
    config: {
      title: "Create New Template",
      description: "Create a new dynamic transactional template",
      inputSchema: {
        name: z.string().describe("Name of the template"),
        generation: z.enum(["legacy", "dynamic"]).optional().default("dynamic").describe("Template generation type"),
      },
    },
  • src/index.ts:21-23 (registration)
    The MCP server tool registration loop that dynamically registers all tools from the allTools object, including 'create_template' from the templates tools group.
    for (const [name, tool] of Object.entries(allTools)) {
      server.registerTool(name, tool.config as any, tool.handler as any);
    }
  • Aggregation of all template tools (including create_template) into the central allTools export via object spread.
    ...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. While 'Create' implies a write operation, the description doesn't address permission requirements, whether the operation is idempotent, what happens on failure, or what the response contains. 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 that communicates the core purpose without unnecessary words. It's appropriately sized for a simple creation tool and front-loads the essential information.

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 mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what a 'dynamic transactional template' is, what happens after creation, or how this differs from similar creation tools. The agent lacks necessary context to use this tool effectively.

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 already fully documents both parameters. The description mentions 'dynamic transactional template' which relates to the 'generation' parameter's 'dynamic' enum value, but doesn't add meaningful semantic context beyond what the schema provides. This meets the baseline expectation when schema coverage is complete.

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 ('Create') and resource ('new dynamic transactional template'), making the purpose immediately understandable. However, it doesn't distinguish this tool from sibling tools like 'create_html_template' or 'create_template_version', which would require more specific differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives like 'create_html_template' or 'create_template_version'. There's no mention of prerequisites, constraints, or typical use cases, leaving the agent with insufficient context for appropriate tool selection.

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