Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

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); }

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