Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

Delete Contact

delete_contact

Remove contacts from your SendGrid email marketing list by specifying their unique IDs to manage your subscriber database.

Instructions

Delete contacts by IDs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contact_idsYesArray of contact IDs to delete

Implementation Reference

  • Handler function that checks read-only mode and deletes the specified contacts via SendGrid API DELETE /v3/marketing/contacts?ids=... request.
    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)}` }] };
    },
  • Tool configuration with title, description, and Zod input schema validating an array of contact IDs.
    config: {
      title: "Delete Contact",
      description: "Delete contacts by IDs",
      inputSchema: {
        contact_ids: z.array(z.string()).describe("Array of contact IDs to delete"),
      },
    },
  • src/index.ts:21-23 (registration)
    Registers all tools including 'delete_contact' with the MCP server by iterating over allTools.
    for (const [name, tool] of Object.entries(allTools)) {
      server.registerTool(name, tool.config as any, tool.handler as any);
    }
  • Includes contactTools (containing delete_contact) in the aggregated allTools export.
    ...contactTools,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Delete contacts by IDs' implies a destructive, irreversible operation, but it doesn't specify whether deletion is permanent or recoverable, what permissions are required, if there are rate limits, or what happens to associated data (e.g., lists, custom fields). For a destructive tool with zero annotation coverage, this is a significant gap in safety and operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It is front-loaded with the core action ('Delete contacts'), making it immediately understandable. No extraneous information or redundancy is present, earning a perfect score for conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's destructive nature, lack of annotations, and no output schema, the description is incomplete. It doesn't address critical context such as the permanence of deletion, error handling, response format, or dependencies on other tools (e.g., needing valid IDs). For a high-stakes operation like contact deletion, more guidance is warranted to ensure safe and correct usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with 'contact_ids' clearly documented as 'Array of contact IDs to delete'. The description 'Delete contacts by IDs' adds minimal value beyond this, as it essentially restates the parameter's purpose without providing additional semantics like ID format, constraints, or examples. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Delete contacts by IDs' clearly states the verb (delete) and resource (contacts), specifying the mechanism (by IDs). It distinguishes from siblings like 'remove_contact_from_lists' (which removes from lists rather than deleting) and 'update_contact' (which modifies rather than deletes). However, it doesn't explicitly mention permanent deletion versus soft deletion, which could be a subtle distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing contact IDs from 'list_contacts' or 'search_contacts'), exclusions (e.g., cannot delete contacts in certain states), or comparisons with similar tools like 'delete_segment' or 'remove_contact_from_lists'. The agent must infer usage from context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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