Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

delete_email_list

Remove an email list from your SendGrid account to manage contacts and clean up outdated or unused mailing lists.

Instructions

Delete an existing email list from your SendGrid account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYesID of the email list to delete

Implementation Reference

  • The main handler function that executes the delete_email_list tool. It checks for read-only mode, then makes a DELETE request to the SendGrid Marketing Lists API endpoint to delete the list by ID.
    handler: async ({ list_id }: { list_id: string }): Promise<ToolResult> => { const readOnlyCheck = checkReadOnlyMode(); if (readOnlyCheck.blocked) { return { content: [{ type: "text", text: readOnlyCheck.message! }] }; } const result = await makeRequest(`https://api.sendgrid.com/v3/marketing/lists/${list_id}`, { method: "DELETE", }); return { content: [{ type: "text", text: `List ${list_id} deleted successfully.` }] }; },
  • The tool's configuration object, including title, description, and Zod input schema defining the required 'list_id' string parameter.
    config: { title: "Delete Email List", description: "Delete an existing email list from your SendGrid account", inputSchema: { list_id: z.string().describe("ID of the email list to delete"), }, },
  • src/index.ts:22-23 (registration)
    The MCP server registration loop that dynamically registers the delete_email_list tool (along with all others from allTools) using its config and handler.
    server.registerTool(name, tool.config as any, tool.handler as any); }

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/deyikong/sendgrid-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server