Skip to main content
Glama
phxdev1

People Data Labs MCP Server

search_locations

Utilize SQL-like queries to find locations based on specific criteria, returning up to 100 results for targeted searches using data models from People Data Labs.

Instructions

Search for locations matching specific criteria

Input Schema

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

Implementation Reference

  • Core handler function implementing the search_locations tool logic. Validates input arguments, constructs API parameters with SQL query, calls People Data Labs /location/search endpoint, and returns JSON response.
    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 for the search_locations tool, specifying query (required) and optional size parameters.
    { name: 'search_locations', description: 'Search for locations matching specific criteria', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'SQL-like query to search for locations', }, size: { type: 'number', description: 'Number of results to return (max 100)', minimum: 1, maximum: 100, }, }, required: ['query'], }, },
  • src/index.ts:414-415 (registration)
    Registration and dispatch handler for search_locations tool in the CallToolRequestSchema switch statement, invoking handleSearch with 'location' dataType.
    case 'search_locations': return await this.handleSearch('location', request.params.arguments);
  • Helper validation function for search tool arguments, ensuring query is string and size is valid number (1-100), used by search_locations handler.
    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)); };

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