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
| Name | Required | Description | Default |
|---|---|---|---|
| emails | Yes | Array of email addresses to search for |
Implementation Reference
- src/tools/contacts.ts:436-442 (handler)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) }] }; },
- src/tools/contacts.ts:432-434 (schema)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"), },
- src/tools/contacts.ts:428-443 (registration)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) }] }; }, },
- src/tools/index.ts:9-17 (registration)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, };