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}` }] };

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