Skip to main content
Glama
phxdev1

People Data Labs MCP Server

search_companies

Find companies by applying SQL-like queries to filter results based on specific criteria, with customizable result sizes up to 100 matches.

Instructions

Search for companies matching specific criteria

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSQL-like query to search for companies
sizeNoNumber of results to return (max 100)

Implementation Reference

  • Core handler function that implements the search_companies tool logic by calling the People Data Labs /company/search API endpoint with the provided SQL query.
    private async handleSearch(dataType: string, args: any) {
      if (!isValidSearchArgs(args)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          `Invalid search parameters. Must provide a query string.`
        );
      }
    
      const params: Record<string, any> = {
        sql: args.query,
        size: args.size || 10,
      };
    
      const response = await pdlApi.get(`/${dataType}/search`, { params });
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(response.data, null, 2),
          },
        ],
      };
    }
  • Input schema definition and tool registration for search_companies in the ListTools response.
    {
      name: 'search_companies',
      description: 'Search for companies matching specific criteria',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'SQL-like query to search for companies',
          },
          size: {
            type: 'number',
            description: 'Number of results to return (max 100)',
            minimum: 1,
            maximum: 100,
          },
        },
        required: ['query'],
      },
  • src/index.ts:406-407 (registration)
    Switch case registration that routes search_companies tool calls to the handleSearch function with 'company' data type.
    case 'search_companies':
      return await this.handleSearch('company', request.params.arguments);
  • Validation helper function used by handleSearch to validate input arguments for search tools including search_companies.
    const isValidSearchArgs = (args: any): args is {
      query: string;
      size?: number;
    } => {
      return typeof args === 'object' &&
             args !== null &&
             typeof args.query === 'string' &&
             (args.size === undefined || (typeof args.size === 'number' && args.size > 0 && args.size <= 100));
    };

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other Tools

Related Tools

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/phxdev1/peopledatalabs-mcp'

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