Skip to main content
Glama
Garoth

SendGrid MCP Server

by Garoth

list_templates

Retrieve all email templates from your SendGrid account to manage and reuse them for email campaigns.

Instructions

List all email templates in your SendGrid account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_templates' tool call. It invokes service.listTemplates() and formats the response as a JSON string of template summaries.
    case 'list_templates': const templates = await service.listTemplates(); return { content: [{ type: 'text', text: JSON.stringify(templates.map(t => ({ id: t.id, name: t.name, generation: t.generation, updated_at: t.updated_at, versions: t.versions.length })), null, 2) }] };
  • Registration of the 'list_templates' tool in getToolDefinitions, including name, description, and input schema (empty object).
    { name: 'list_templates', description: 'List all email templates in your SendGrid account', inputSchema: { type: 'object', properties: {}, required: [] } },
  • Input schema for the 'list_templates' tool: an empty object with no required properties.
    inputSchema: { type: 'object', properties: {}, required: [] }
  • Helper method in SendGridService that fetches the list of dynamic templates from the SendGrid API.
    async listTemplates(): Promise<SendGridTemplate[]> { const [response] = await this.client.request({ method: 'GET', url: '/v3/templates', qs: { generations: 'dynamic' } }); return ((response.body as { templates: SendGridTemplate[] }).templates || []); }

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