retrieve_contacts
Extract email addresses and phone numbers from LinkedIn profiles using profile URLs to obtain contact information for professional networking.
Instructions
Retrieves email addresses and phone numbers for a LinkedIn profile. Each lookup costs 1 credit.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| linkedin_url | Yes | The LinkedIn profile URL to look up. |
Implementation Reference
- src/tools/retrieve-contacts.ts:16-39 (handler)The handler function that executes the retrieve_contacts tool. It takes a LinkedIn URL, makes an API request to fetch contact information, handles errors, and returns the response.export const retrieveContactsTool = async ({ linkedin_url, }: RetrieveContactsParams) => { const apiUrl = new URL("https://search.linkd.inc/api/enrich/contacts"); apiUrl.searchParams.append("linkedin_url", linkedin_url); const response = await makeLinkdRequest(apiUrl.toString(), {}); const responseData = await response.json(); if (responseData.error) { throw new Error( `Failed to retrieve contact information: ${JSON.stringify(responseData.error)}` ); } return { content: [ { type: "text" as const, text: `contact information retrieved successfully: ${JSON.stringify(responseData, null, 2)}` } ] }; };
- src/tools/retrieve-contacts.ts:4-14 (schema)Tool name, description, input schema (Zod validator), and TypeScript type for parameters.export const retrieveContactsName = "retrieve_contacts"; export const retrieveContactsDescription = "Retrieves email addresses and phone numbers for a LinkedIn profile. Each lookup costs 1 credit."; export const retrieveContactsSchema = { linkedin_url: z.string().describe("The LinkedIn profile URL to look up."), }; type RetrieveContactsParams = { linkedin_url: string; };
- src/server_setup.ts:33-38 (registration)Registration of the retrieve_contacts tool with the MCP server using the name, description, schema, and handler.server.tool( retrieveContactsName, retrieveContactsDescription, retrieveContactsSchema, retrieveContactsTool );