query_npi_providers
Search the National Provider Identifier registry for healthcare providers by state, specialty, name, city, or ZIP code to find medical professionals and facilities.
Instructions
Search the NPI (National Provider Identifier) registry for healthcare providers. Filter by state, specialty, name, city, or ZIP code. Returns up to 100 results per query. Source: CMS NPPES, updated weekly. ~7.2 million providers.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | No | Two-letter US state code (e.g. CA, NY, TX) | |
| specialty | No | Provider specialty or taxonomy description (e.g. Cardiology, Family Medicine) | |
| name | No | Provider name (partial match on first or last name, or organization name) | |
| city | No | City name | |
| zip | No | 5-digit ZIP code | |
| limit | No | Maximum number of results to return (default 25, max 100) |
Implementation Reference
- src/tools/npi.ts:69-98 (handler)The handler function for the `query_npi_providers` tool.
async ({ state, specialty, name, city, zip, limit }) => { const res = await apiGet<NpiQueryResponse>("/api/v1/npi", { state, specialty, name, city, zip, limit: limit ?? 25, }); if (!res.ok) { return { content: [ { type: "text" as const, text: `API error (${res.status}): ${JSON.stringify(res.data)}`, }, ], isError: true, }; } const { count, data } = res.data; const summary = `Found ${count} NPI provider(s).`; const json = JSON.stringify(data, null, 2); return { content: [{ type: "text" as const, text: `${summary}\n\n${json}` }], }; }, - src/tools/npi.ts:37-67 (schema)Input validation schema for the `query_npi_providers` tool.
inputSchema: { state: z .string() .length(2) .optional() .describe("Two-letter US state code (e.g. CA, NY, TX)"), specialty: z .string() .optional() .describe( "Provider specialty or taxonomy description (e.g. Cardiology, Family Medicine)", ), name: z .string() .optional() .describe( "Provider name (partial match on first or last name, or organization name)", ), city: z.string().optional().describe("City name"), zip: z .string() .optional() .describe("5-digit ZIP code"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum number of results to return (default 25, max 100)"), }, - src/tools/npi.ts:29-68 (registration)Registration of the `query_npi_providers` tool.
server.registerTool( "query_npi_providers", { title: "Query NPI Providers", description: "Search the NPI (National Provider Identifier) registry for healthcare providers. " + "Filter by state, specialty, name, city, or ZIP code. Returns up to 100 results per query. " + "Source: CMS NPPES, updated weekly. ~7.2 million providers.", inputSchema: { state: z .string() .length(2) .optional() .describe("Two-letter US state code (e.g. CA, NY, TX)"), specialty: z .string() .optional() .describe( "Provider specialty or taxonomy description (e.g. Cardiology, Family Medicine)", ), name: z .string() .optional() .describe( "Provider name (partial match on first or last name, or organization name)", ), city: z.string().optional().describe("City name"), zip: z .string() .optional() .describe("5-digit ZIP code"), limit: z .number() .int() .min(1) .max(100) .optional() .describe("Maximum number of results to return (default 25, max 100)"), }, },