Skip to main content
Glama
Garoth

SendGrid MCP Server

by Garoth

create_contact_list

Create a new contact list in SendGrid to organize email recipients for targeted marketing campaigns.

Instructions

Create a new contact list in SendGrid

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the contact list

Implementation Reference

  • Handler logic for the 'create_contact_list' tool within the handleToolCall switch statement. It invokes SendGridService.createList with the input 'name' argument and returns a formatted success response including the new list ID.
    case 'create_contact_list':
      const list = await service.createList(args.name);
      return { content: [{ type: 'text', text: `Contact list "${args.name}" created with ID: ${list.id}` }] };
  • Tool definition including name, description, and input schema requiring a 'name' string parameter.
    {
      name: 'create_contact_list',
      description: 'Create a new contact list in SendGrid',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name of the contact list'
          }
        },
        required: ['name']
      }
    },
  • SendGridService method that performs the actual API call to create a new contact list using SendGrid's Marketing Lists endpoint.
    async createList(name: string): Promise<SendGridList> {
      const [response] = await this.client.request({
        method: 'POST',
        url: '/v3/marketing/lists',
        body: { name }
      });
      return response.body as SendGridList;
    }

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