search_people
Search for individuals using SQL-like queries to match specific criteria, enabling precise identification and retrieval of relevant profiles from People Data Labs' extensive dataset.
Instructions
Search for people matching specific criteria
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | SQL-like query to search for people | |
| size | No | Number of results to return (max 100) |
Implementation Reference
- src/index.ts:543-566 (handler)The handler function that implements the core logic for the 'search_people' tool. It validates input, constructs the API request to People Data Labs '/person/search' endpoint (with dataType='person'), and returns the 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), }, ], }; }
- src/index.ts:398-399 (registration)Switch case that registers and routes incoming 'search_people' tool calls to the handleSearch handler with 'person' dataType.case 'search_people': return await this.handleSearch('person', request.params.arguments);
- src/index.ts:175-192 (schema)Tool registration in ListTools response, including name, description, and input schema definition for 'search_people'.name: 'search_people', description: 'Search for people matching specific criteria', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'SQL-like query to search for people', }, size: { type: 'number', description: 'Number of results to return (max 100)', minimum: 1, maximum: 100, }, }, required: ['query'], },
- src/index.ts:82-90 (helper)Type guard helper function used to validate input arguments for the search_people tool (and other search tools).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)); };