Skip to main content
Glama

lookup_npi

Retrieve detailed healthcare provider information using a 10-digit NPI number. Access provider name, address, specialty, and enumeration date through Verilex Data's structured dataset.

Instructions

Look up a single healthcare provider by their 10-digit NPI number. Returns full provider details including name, address, specialty, and enumeration date.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
npiYesThe 10-digit NPI number

Implementation Reference

  • Implementation of the 'lookup_npi' tool registration and its handler logic.
    server.registerTool(
      "lookup_npi",
      {
        title: "Lookup NPI Provider",
        description:
          "Look up a single healthcare provider by their 10-digit NPI number. " +
          "Returns full provider details including name, address, specialty, and enumeration date.",
        inputSchema: {
          npi: z
            .string()
            .regex(/^\d{10}$/, "NPI must be exactly 10 digits")
            .describe("The 10-digit NPI number"),
        },
      },
      async ({ npi }) => {
        const res = await apiGet<{ dataset: string; data: Record<string, unknown> }>(
          `/api/v1/npi/${npi}`,
        );
    
        if (!res.ok) {
          const msg =
            res.status === 404
              ? `NPI ${npi} not found in the registry.`
              : `API error (${res.status}): ${JSON.stringify(res.data)}`;
          return {
            content: [{ type: "text" as const, text: msg }],
            isError: res.status !== 404,
          };
        }
    
        return {
          content: [
            { type: "text" as const, text: JSON.stringify(res.data.data, null, 2) },
          ],
        };
      },
    );

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/carrierone/verilexdata-mcp'

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