get_contact
Retrieve detailed contact information from SendGrid using the contact ID to access email marketing data and manage subscriber profiles.
Instructions
Get detailed information about a specific contact by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contact_id | Yes | ID of the contact to retrieve |
Implementation Reference
- src/tools/contacts.ts:359-362 (handler)The handler function that performs a GET request to the SendGrid API to retrieve detailed contact information by ID and returns it as formatted JSON.handler: async ({ contact_id }: { contact_id: string }): Promise<ToolResult> => { const result = await makeRequest(`https://api.sendgrid.com/v3/marketing/contacts/${contact_id}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; },
- src/tools/contacts.ts:352-358 (schema)Tool configuration defining title, description, and input schema (Zod validation for required contact_id string).config: { title: "Get Contact Details", description: "Get detailed information about a specific contact by ID", inputSchema: { contact_id: z.string().describe("ID of the contact to retrieve"), }, },
- src/tools/index.ts:9-17 (registration)Aggregates contactTools (containing get_contact) with other toolsets into the allTools object used for MCP registration.export const allTools = { ...automationTools, ...campaignTools, ...contactTools, ...mailTools, ...miscTools, ...statsTools, ...templateTools, };
- src/index.ts:21-23 (registration)Registers all tools from allTools, including get_contact, with the MCP server using registerTool(name, config, handler).for (const [name, tool] of Object.entries(allTools)) { server.registerTool(name, tool.config as any, tool.handler as any); }