Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

delete_contact

Remove contacts from your SendGrid account by specifying their unique IDs to maintain clean and current contact lists.

Instructions

Delete contacts by IDs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contact_idsYesArray of contact IDs to delete

Implementation Reference

  • The main handler function that performs the DELETE request to the SendGrid API to delete specified contacts.
    handler: async ({ contact_ids }: { contact_ids: 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/contacts?ids=${contact_ids.join(',')}`, { method: "DELETE", }); return { content: [{ type: "text", text: `${contact_ids.length} contact(s) deleted successfully.\n\n${JSON.stringify(result, null, 2)}` }] }; },
  • Zod input schema defining the required 'contact_ids' array parameter.
    inputSchema: { contact_ids: z.array(z.string()).describe("Array of contact IDs to delete"), },
  • src/index.ts:21-23 (registration)
    Registration loop that registers the 'delete_contact' tool (along with others) with the MCP server using registerTool.
    for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }
  • Spreads contactTools (including delete_contact) into the allTools export.
    ...contactTools,
  • Full tool config including title, description, and input schema.
    config: { title: "Delete Contact", description: "Delete contacts by IDs", inputSchema: { contact_ids: z.array(z.string()).describe("Array of contact IDs to delete"), }, },

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