Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

Search Contacts by Email Addresses

search_contacts_by_emails

Find SendGrid contacts using their email addresses. Input email addresses to retrieve contact information from your SendGrid account.

Instructions

Search for specific contacts by their email addresses

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailsYesArray of email addresses to search for

Implementation Reference

  • The handler function that executes the core logic: sends a POST request to SendGrid API's /marketing/contacts/search/emails endpoint with the emails array and returns the JSON response.
    handler: async ({ emails }: { emails: string[] }): Promise<ToolResult> => {
      const result = await makeRequest("https://api.sendgrid.com/v3/marketing/contacts/search/emails", {
        method: "POST",
        body: JSON.stringify({ emails }),
      });
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    },
  • The tool configuration including title, description, and Zod input schema for validating the emails array parameter.
    config: {
      title: "Search Contacts by Email Addresses",
      description: "Search for specific contacts by their email addresses",
      inputSchema: {
        emails: z.array(z.string().email()).describe("Array of email addresses to search for"),
      },
    },
  • Spreads contactTools (which contains search_contacts_by_emails) into the allTools object exported for registration.
    export const allTools = {
      ...automationTools,
      ...campaignTools,
      ...contactTools,
      ...mailTools,
      ...miscTools,
      ...statsTools,
      ...templateTools,
  • src/index.ts:20-23 (registration)
    The MCP server registration loop that registers all tools from allTools, including search_contacts_by_emails, using registerTool.
    // Register all tools
    for (const [name, tool] of Object.entries(allTools)) {
      server.registerTool(name, tool.config as any, tool.handler as any);
    }
Behavior2/5

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

With no annotations, the description carries full burden but provides minimal behavioral insight. It doesn't disclose whether this is a read-only operation, how results are returned (e.g., partial matches, error handling for invalid emails), or any rate limits. 'Search' implies non-destructive reading, but specifics are missing.

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—front-loaded and directly states the tool's function. Every word earns its place without redundancy or fluff.

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?

For a search tool with no annotations and no output schema, the description is incomplete. It lacks details on return values (e.g., contact objects, error responses), behavioral traits like idempotency or pagination, and usage context relative to siblings. The high schema coverage doesn't compensate for these gaps.

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?

Schema description coverage is 100%, with the 'emails' parameter fully documented in the schema. The description adds no additional meaning beyond stating 'email addresses to search for,' which merely restates the schema. Baseline 3 is appropriate as the schema handles parameter documentation.

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 clearly states the verb ('search for') and resource ('contacts'), specifying the search criteria ('by their email addresses'). It distinguishes from generic 'search_contacts' by focusing on email lookup, but doesn't explicitly contrast with other email-related tools like 'get_contact'.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_contact' (for single contact lookup) or 'list_contacts' (for bulk listing). The description implies usage for email-based searches but lacks explicit context or exclusions.

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