Skip to main content
Glama
phxdev1

People Data Labs MCP Server

search_schools

Search for schools using SQL-like queries to match specific criteria, with options to control the number of results returned.

Instructions

Search for schools matching specific criteria

Input Schema

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

Implementation Reference

  • Generic search handler that executes the search_schools tool logic by calling the People Data Labs API endpoint /school/search with the 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), }, ], }; }
  • Tool schema definition including name, description, and input schema for search_schools.
    { name: 'search_schools', description: 'Search for schools matching specific criteria', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'SQL-like query to search for schools', }, size: { type: 'number', description: 'Number of results to return (max 100)', minimum: 1, maximum: 100, }, }, required: ['query'], }, },
  • src/index.ts:410-411 (registration)
    Switch case that registers and routes calls to the search_schools tool handler.
    case 'search_schools': return await this.handleSearch('school', request.params.arguments);
  • Helper function to validate input arguments for search tools including search_schools.
    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