Skip to main content
Glama
Garoth

SendGrid MCP Server

by Garoth

delete_list

Remove a contact list from SendGrid's email marketing platform by specifying its ID to manage subscriber data.

Instructions

Delete a contact list from SendGrid

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYesID of the contact list to delete

Implementation Reference

  • The core handler function in SendGridService that performs the API call to delete a marketing contact list by its ID.
    async deleteList(listId: string): Promise<void> {
      await this.client.request({
        method: 'DELETE',
        url: `/v3/marketing/lists/${listId}`
      });
    }
  • The tool registration definition including name, description, and input schema for the 'delete_list' tool in getToolDefinitions.
    {
      name: 'delete_list',
      description: 'Delete a contact list from SendGrid',
      inputSchema: {
        type: 'object',
        properties: {
          list_id: {
            type: 'string',
            description: 'ID of the contact list to delete'
          }
        },
        required: ['list_id']
      }
    },
  • The switch case handler in handleToolCall that invokes the service.deleteList method and returns a success message.
    case 'delete_list':
      await service.deleteList(args.list_id);
      return { content: [{ type: 'text', text: `Contact list ${args.list_id} deleted successfully` }] };
  • The input schema definition for the 'delete_list' tool, specifying the required 'list_id' parameter.
    inputSchema: {
      type: 'object',
      properties: {
        list_id: {
          type: 'string',
          description: 'ID of the contact list to delete'
        }
      },
      required: ['list_id']

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