Skip to main content
Glama
Meerkats-Ai

Hatch MCP Server

by Meerkats-Ai

hatch_find_company_data

Retrieve detailed company information by entering a domain name. This tool helps users gather business data for research, verification, or outreach purposes.

Instructions

Find detailed information about a company using its domain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesCompany domain name

Implementation Reference

  • Handler for the 'hatch_find_company_data' tool: validates input using type guard, calls Hatch API endpoint '/v1/findCompanyData' with retry logic, returns JSON response or error.
    case 'hatch_find_company_data': {
      if (!isFindCompanyDataParams(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Invalid arguments for hatch_find_company_data'
        );
      }
    
      try {
        const response = await withRetry(
          async () => apiClient.post('/v1/findCompanyData', args),
          'find company data'
        );
    
        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,
        };
      }
    }
  • Tool schema definition including name, description, and input schema requiring 'domain' string.
    const FIND_COMPANY_DATA_TOOL: Tool = {
      name: 'hatch_find_company_data',
      description: 'Find detailed information about a company using its domain.',
      inputSchema: {
        type: 'object',
        properties: {
          domain: {
            type: 'string',
            description: 'Company domain name',
          },
        },
        required: ['domain'],
      },
    };
  • src/index.ts:313-320 (registration)
    Registration of the tool in the listTools request handler by including FIND_COMPANY_DATA_TOOL in the tools array.
      tools: [
        FIND_EMAIL_TOOL,
        FIND_PHONE_TOOL,
        VERIFY_EMAIL_TOOL,
        FIND_COMPANY_DATA_TOOL,
        GET_LINKEDIN_URL_TOOL,
      ],
    }));
  • Type guard helper function to validate arguments for hatch_find_company_data tool.
    function isFindCompanyDataParams(args: unknown): args is FindCompanyDataParams {
      return (
        typeof args === 'object' &&
        args !== null &&
        'domain' in args &&
        typeof (args as { domain: unknown }).domain === 'string'
      );
    }
  • TypeScript interface defining the input parameters for the tool.
    interface FindCompanyDataParams {
      domain: 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