getContact
Retrieve comprehensive contact details including emails, phone numbers, social links, and notes by inputting a contact ID using Clay's MCP server tools.
Instructions
Get details for a contact by id, including emails, social links, phone numbers, and notes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contact_id | Yes | The ID of the contact to get details for. |
Implementation Reference
- index.js:187-197 (registration)Registration of the MCP tool 'getContact' including name, description, input schema, and execute handler that proxies to external API.server.addTool({ name: "getContact", description: "Get details for a contact by id, including emails, social links, phone numbers, and notes.", parameters: z.object({ contact_id: z .number() .describe("The ID of the contact to get details for."), }), execute: async (params, { session }) => callTool("/get-contact", params, session), });
- index.js:191-195 (schema)Input schema for 'getContact' tool using Zod: requires contact_id as number.parameters: z.object({ contact_id: z .number() .describe("The ID of the contact to get details for."), }),
- index.js:196-196 (handler)Handler (execute function) for 'getContact' tool: forwards params to external endpoint '/get-contact' via callTool helper.execute: async (params, { session }) => callTool("/get-contact", params, session),
- index.js:31-41 (helper)Utility function used by getContact handler to make authenticated HTTP POST request to Clay's external API.async function callTool(path, params, session) { console.log('Calling tool', path, session) return fetch(`https://nexum.clay.earth/tools${path}`, { body: JSON.stringify(params), headers: { Authorization: `ApiKey ${session.apiKey}`, "Content-Type": "application/json", }, method: "POST", }).then((res) => res.text()); }