Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

delete_email_list

Remove an email list from your SendGrid account by providing the list ID to manage your contact lists and maintain organized email marketing operations.

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 handler function that performs the actual deletion of the email list using the SendGrid API, after checking if read-only mode is enabled.
    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 configuration including title, description, and input schema using Zod for validation.
    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:21-23 (registration)
    Generic registration of all tools (including delete_email_list) to the MCP server by iterating over allTools and calling registerTool.
    for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }
  • Aggregation of all individual tool sets into allTools, which includes contactTools containing delete_email_list.
    export const allTools = { ...automationTools, ...campaignTools, ...contactTools, ...mailTools, ...miscTools, ...statsTools, ...templateTools,

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