hatch_get_linkedin_url
Find LinkedIn profiles by entering a person's name, job title, and company. This tool helps locate professional contact information for networking or verification purposes.
Instructions
Find LinkedIn URL using name, designation, and company information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Name of the person | |
| designation | No | Job title or designation of the person | |
| companyName | Yes | Company name |
Implementation Reference
- src/index.ts:478-511 (handler)The main handler for the 'hatch_get_linkedin_url' tool. Validates input using the type guard, makes a POST request to the Hatch API '/v1/getLinkedinUrl' endpoint with retry logic, and returns the JSON response or formatted error.case 'hatch_get_linkedin_url': { if (!isGetLinkedInUrlParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for hatch_get_linkedin_url' ); } try { const response = await withRetry( async () => apiClient.post('/v1/getLinkedinUrl', args), 'get linkedin url' ); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], isError: false, }; } catch (error) { const errorMessage = axios.isAxiosError(error) ? `API Error: ${error.response?.data?.message || error.message}` : `Error: ${error instanceof Error ? error.message : String(error)}`; return { content: [{ type: 'text', text: errorMessage }], isError: true, }; } }
- src/index.ts:86-107 (schema)Tool definition including name, description, and input schema for 'hatch_get_linkedin_url', specifying properties for name, designation (optional), and required companyName.const GET_LINKEDIN_URL_TOOL: Tool = { name: 'hatch_get_linkedin_url', description: 'Find LinkedIn URL using name, designation, and company information.', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the person', }, designation: { type: 'string', description: 'Job title or designation of the person', }, companyName: { type: 'string', description: 'Company name', }, }, required: ['companyName'], }, };
- src/index.ts:314-319 (registration)Registration of the 'hatch_get_linkedin_url' tool (as GET_LINKEDIN_URL_TOOL) in the listTools response handler.FIND_EMAIL_TOOL, FIND_PHONE_TOOL, VERIFY_EMAIL_TOOL, FIND_COMPANY_DATA_TOOL, GET_LINKEDIN_URL_TOOL, ],
- src/index.ts:128-132 (schema)TypeScript interface defining the input parameters for the 'hatch_get_linkedin_url' tool.interface GetLinkedInUrlParams { name?: string; designation?: string; companyName: string; }
- src/index.ts:175-203 (helper)Type guard helper function to validate and type-check input arguments for the 'hatch_get_linkedin_url' handler.function isGetLinkedInUrlParams(args: unknown): args is GetLinkedInUrlParams { if ( typeof args !== 'object' || args === null || !('companyName' in args) || typeof (args as { companyName: unknown }).companyName !== 'string' ) { return false; } // Optional parameters if ( 'name' in args && (args as { name: unknown }).name !== undefined && typeof (args as { name: unknown }).name !== 'string' ) { return false; } if ( 'designation' in args && (args as { designation: unknown }).designation !== undefined && typeof (args as { designation: unknown }).designation !== 'string' ) { return false; } return true; }