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
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | ID of the email list to delete |
Implementation Reference
- src/tools/contacts.ts:74-84 (handler)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.` }] }; },
- src/tools/contacts.ts:67-73 (schema)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); }
- src/tools/index.ts:9-16 (registration)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,