Skip to main content
Glama
Garoth

SendGrid MCP Server

by Garoth

send_email

Send emails programmatically using SendGrid's API to deliver messages with plain text, HTML, or dynamic templates to verified recipients.

Instructions

Send an email using SendGrid

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesRecipient email address
subjectYesEmail subject line
textYesPlain text content of the email
htmlNoHTML content of the email (optional)
fromYesSender email address (must be verified with SendGrid)
template_idNoSendGrid template ID (optional)
dynamic_template_dataNoDynamic data for template variables (optional)

Implementation Reference

  • Core implementation of the send_email tool: sends email using SendGrid's sgMail.send API.
    async sendEmail(params: {
      to: string;
      from: string;
      subject: string;
      text: string;
      html?: string;
      template_id?: string;
      dynamic_template_data?: Record<string, any>;
    }) {
      return await sgMail.send(params);
    }
  • Input schema definition for the send_email tool, specifying parameters and validation.
    inputSchema: {
      type: 'object',
      properties: {
        to: {
          type: 'string',
          description: 'Recipient email address'
        },
        subject: {
          type: 'string',
          description: 'Email subject line'
        },
        text: {
          type: 'string',
          description: 'Plain text content of the email'
        },
        html: {
          type: 'string',
          description: 'HTML content of the email (optional)'
        },
        from: {
          type: 'string',
          description: 'Sender email address (must be verified with SendGrid)'
        },
        template_id: {
          type: 'string',
          description: 'SendGrid template ID (optional)'
        },
        dynamic_template_data: {
          type: 'object',
          description: 'Dynamic data for template variables (optional)'
        }
      },
      required: ['to', 'subject', 'text', 'from']
    }
  • Registration of the send_email tool in the getToolDefinitions array.
    {
      name: 'send_email',
      description: 'Send an email using SendGrid',
      inputSchema: {
        type: 'object',
        properties: {
          to: {
            type: 'string',
            description: 'Recipient email address'
          },
          subject: {
            type: 'string',
            description: 'Email subject line'
          },
          text: {
            type: 'string',
            description: 'Plain text content of the email'
          },
          html: {
            type: 'string',
            description: 'HTML content of the email (optional)'
          },
          from: {
            type: 'string',
            description: 'Sender email address (must be verified with SendGrid)'
          },
          template_id: {
            type: 'string',
            description: 'SendGrid template ID (optional)'
          },
          dynamic_template_data: {
            type: 'object',
            description: 'Dynamic data for template variables (optional)'
          }
        },
        required: ['to', 'subject', 'text', 'from']
      }
    },
  • Tool invocation handler in handleToolCall that delegates to SendGridService.sendEmail.
    case 'send_email':
      await service.sendEmail(args);
      return { content: [{ type: 'text', text: `Email sent successfully to ${args.to}` }] };
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 tool sends emails but doesn't mention critical behaviors: whether it's transactional vs. marketing, rate limits, delivery confirmation, error handling, or authentication requirements. The mention of 'SendGrid' implies external service dependencies but lacks specifics.

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 wasted words. It's front-loaded with the core purpose and provides essential context (SendGrid) without unnecessary elaboration.

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 7-parameter mutation tool with no annotations and no output schema, the description is inadequate. It doesn't cover behavioral aspects like side effects, error responses, or success indicators. The complexity of email sending (with templates, dynamic data, and external dependencies) warrants more comprehensive guidance.

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 all 7 parameters. The description adds no parameter-specific information beyond what's in the schema (e.g., it doesn't explain the relationship between 'text' and 'html', or when to use 'template_id'). Baseline 3 is appropriate when the schema does all the work.

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 ('Send an email') and specifies the service provider ('using SendGrid'), which distinguishes it from generic email tools. However, it doesn't explicitly differentiate from sibling tools like 'send_to_list' or 'get_single_send', which are also SendGrid-related operations.

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 'send_to_list' (for bulk emails) or 'get_single_send' (for scheduled campaigns). It mentions SendGrid but doesn't specify prerequisites like verified sender addresses or when to choose templates over direct content.

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/Garoth/sendgrid-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server