hatch_find_phone
Extract phone numbers from LinkedIn profiles by providing the profile URL to locate contact information.
Instructions
Find a phone number using LinkedIn profile URL.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| linkedInUrl | Yes | LinkedIn profile URL of the person |
Implementation Reference
- src/index.ts:373-406 (handler)The main handler logic for the 'hatch_find_phone' tool, which validates input using isFindPhoneParams, calls the Hatch API endpoint '/v1/findPhone', and returns the response or error.case 'hatch_find_phone': { if (!isFindPhoneParams(args)) { throw new McpError( ErrorCode.InvalidParams, 'Invalid arguments for hatch_find_phone' ); } try { const response = await withRetry( async () => apiClient.post('/v1/findPhone', args), 'find phone' ); 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:41-54 (schema)Defines the tool schema for 'hatch_find_phone', including name, description, and input schema.const FIND_PHONE_TOOL: Tool = { name: 'hatch_find_phone', description: 'Find a phone number using LinkedIn profile URL.', inputSchema: { type: 'object', properties: { linkedInUrl: { type: 'string', description: 'LinkedIn profile URL of the person', }, }, required: ['linkedInUrl'], }, };
- src/index.ts:314-319 (registration)Registers the 'hatch_find_phone' tool (as FIND_PHONE_TOOL) in the list of available tools.FIND_EMAIL_TOOL, FIND_PHONE_TOOL, VERIFY_EMAIL_TOOL, FIND_COMPANY_DATA_TOOL, GET_LINKEDIN_URL_TOOL, ],
- src/index.ts:148-155 (helper)Type guard function to validate input parameters for the 'hatch_find_phone' tool.function isFindPhoneParams(args: unknown): args is FindPhoneParams { return ( typeof args === 'object' && args !== null && 'linkedInUrl' in args && typeof (args as { linkedInUrl: unknown }).linkedInUrl === 'string' ); }
- src/index.ts:116-118 (schema)TypeScript interface defining the expected input parameters for the 'hatch_find_phone' tool.interface FindPhoneParams { linkedInUrl: string; }