Delete Sender Identity
delete_senderRemove a verified sender identity from your SendGrid account using its sender ID. Keep your sender list accurate.
Instructions
Delete a verified sender identity
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sender_id | Yes | ID of the sender identity to delete |
Implementation Reference
- src/tools/contacts.ts:471-482 (handler)The handler function that executes the delete_sender tool logic. It checks read-only mode, then sends a DELETE request to SendGrid's verified_senders API endpoint.
handler: async ({ sender_id }: { sender_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/verified_senders/${sender_id}`, { method: "DELETE", }); return { content: [{ type: "text", text: `Sender identity ${sender_id} deleted successfully.` }] }; }, }, - src/tools/contacts.ts:464-470 (schema)The tool configuration including title, description, and inputSchema (validates sender_id as a required string using Zod).
config: { title: "Delete Sender Identity", description: "Delete a verified sender identity", inputSchema: { sender_id: z.string().describe("ID of the sender identity to delete"), }, }, - src/tools/index.ts:9-17 (registration)The tool is exported via contactTools which is spread into allTools in src/tools/index.ts for registration with the MCP server.
export const allTools = { ...automationTools, ...campaignTools, ...contactTools, ...mailTools, ...miscTools, ...statsTools, ...templateTools, }; - src/tools/contacts.ts:1-4 (helper)Imports used by delete_sender: zod for validation, makeRequest for API calls, ToolResult type, and checkReadOnlyMode for safety checks.
import { z } from "zod"; import { makeRequest } from "../shared/api.js"; import { ContactSchema, ToolResult } from "../shared/types.js"; import { checkReadOnlyMode } from "../shared/env.js";