Skip to main content
Glama
Garoth

SendGrid MCP Server

by Garoth

get_template

Retrieve a SendGrid email template by its ID to reuse content, maintain consistency, and streamline email campaign creation.

Instructions

Retrieve a SendGrid template by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
template_idYesID of the template to retrieve

Implementation Reference

  • Handler logic in handleToolCall function that invokes service.getTemplate with the provided template_id and returns the retrieved template as JSON.
    case 'get_template': const retrievedTemplate = await service.getTemplate(args.template_id); return { content: [{ type: 'text', text: JSON.stringify(retrievedTemplate, null, 2) }] };
  • Tool definition including name, description, and input schema requiring 'template_id' string.
    { name: 'get_template', description: 'Retrieve a SendGrid template by ID', inputSchema: { type: 'object', properties: { template_id: { type: 'string', description: 'ID of the template to retrieve' } }, required: ['template_id'] } },
  • SendGridService method that performs the API request to retrieve the template by ID.
    async getTemplate(templateId: string): Promise<SendGridTemplate> { const [response] = await this.client.request({ method: 'GET', url: `/v3/templates/${templateId}` }); return response.body as SendGridTemplate; }

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