Skip to main content
Glama
deyikong

SendGrid MCP Server

by deyikong

search_contacts_by_emails

Find specific contacts in your SendGrid account using their email addresses to manage and organize your email marketing lists effectively.

Instructions

Search for specific contacts by their email addresses

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailsYesArray of email addresses to search for

Implementation Reference

  • The main handler function that executes the tool by making a POST request to the SendGrid API endpoint for searching contacts by emails and returns the result.
    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) }] }; },
  • Zod schema defining the input as an array of valid email strings.
    inputSchema: { emails: z.array(z.string().email()).describe("Array of email addresses to search for"), },
  • The tool definition and registration within the contactTools object exported from contacts.ts.
    search_contacts_by_emails: { 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"), }, }, 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) }] }; }, },
  • contactTools (including search_contacts_by_emails) is imported and spread into the allTools object for global tool registration.
    export const allTools = { ...automationTools, ...campaignTools, ...contactTools, ...mailTools, ...miscTools, ...statsTools, ...templateTools, };

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