Skip to main content
Glama
Meerkats-Ai

Hatch MCP Server

by Meerkats-Ai

hatch_find_phone

Extract phone numbers from LinkedIn profiles to connect with professionals using their profile URL.

Instructions

Find a phone number using LinkedIn profile URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linkedInUrlYesLinkedIn profile URL of the person

Implementation Reference

  • Handler for the hatch_find_phone tool: validates arguments using isFindPhoneParams type guard, calls the Hatch API endpoint '/v1/findPhone' with retry logic, returns the JSON response or an error message.
    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,
        };
      }
    }
  • Input schema and metadata definition for the hatch_find_phone tool, specifying the required 'linkedInUrl' parameter.
    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:312-320 (registration)
    Tool registration via the ListToolsRequestSchema handler, which advertises the hatch_find_phone tool among others.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        FIND_EMAIL_TOOL,
        FIND_PHONE_TOOL,
        VERIFY_EMAIL_TOOL,
        FIND_COMPANY_DATA_TOOL,
        GET_LINKEDIN_URL_TOOL,
      ],
    }));
  • Type guard function to validate that tool arguments match the expected FindPhoneParams shape for hatch_find_phone.
    function isFindPhoneParams(args: unknown): args is FindPhoneParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'linkedInUrl' in args &&
        typeof (args as { linkedInUrl: unknown }).linkedInUrl === 'string'
      );
    }
  • TypeScript interface defining the input parameters for the hatch_find_phone tool.
    interface FindPhoneParams {
      linkedInUrl: string;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Meerkats-Ai/hatch-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server