Skip to main content
Glama
rkirkendall

Medplum MCP Server

by rkirkendall

searchPractitioners

Locate healthcare practitioners by name, specialty, or identifier using Medplum MCP Server’s search functionality to streamline access to medical data.

Instructions

Searches for practitioners based on various criteria like name, specialty, or identifier.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
familyNoThe practitioner's family (last) name.
givenNoThe practitioner's given (first) name.
identifierNoAn identifier for the practitioner (e.g., NPI value).
nameNoA general name search string.
specialtyNoThe practitioner's specialty (e.g., cardiology).

Implementation Reference

  • The handler function that implements the core logic for searching Practitioner resources using FHIR search parameters built from the input criteria via the Medplum client.
    export async function searchPractitioners(criteria: PractitionerSearchCriteria): Promise<Practitioner[]> {
      await ensureAuthenticated();
      const searchParams: string[] = [];
    
      if (criteria.identifier) searchParams.push(`identifier=${criteria.identifier}`);
      if (criteria.name) searchParams.push(`name:contains=${criteria.name}`);
      if (criteria.givenName) searchParams.push(`given:contains=${criteria.givenName}`);
      if (criteria.familyName) searchParams.push(`family:contains=${criteria.familyName}`);
      if (criteria.addressCity) searchParams.push(`address-city:contains=${criteria.addressCity}`);
      if (criteria.addressState) searchParams.push(`address-state:contains=${criteria.addressState}`);
      if (criteria.telecom) searchParams.push(`telecom=${criteria.telecom}`);
      if (criteria._lastUpdated) searchParams.push(`_lastUpdated=${criteria._lastUpdated}`);
      
      if (searchParams.length === 0) {
        return [];
      }
    
      const queryString = searchParams.join('&');
      return medplum.searchResources('Practitioner', queryString);
    } 
  • The MCP protocol input schema definition for the searchPractitioners tool, defining expected parameters for the tool call.
    {
      name: "searchPractitioners",
      description: "Searches for practitioners based on various criteria like name, specialty, or identifier.",
      inputSchema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "A general name search string.",
          },
          given: {
            type: "string",
            description: "The practitioner's given (first) name.",
          },
          family: {
            type: "string",
            description: "The practitioner's family (last) name.",
          },
          specialty: {
            type: "string",
            description: "The practitioner's specialty (e.g., cardiology).",
          },
          identifier: {
            type: "string",
            description: "An identifier for the practitioner (e.g., NPI value).",
          },
        },
        required: [],
      },
  • src/index.ts:14-19 (registration)
    Import statement registering the searchPractitioners handler function from practitionerUtils into the main server index.
      searchPractitionersByName,
      createPractitioner,
      getPractitionerById,
      updatePractitioner,
      searchPractitioners,
    } from './tools/practitionerUtils.js';
  • src/index.ts:950-988 (registration)
    Tool mapping that associates the tool name 'searchPractitioners' with its handler function for execution in the MCP server request handler.
    const toolMapping: Record<string, (...args: any[]) => Promise<any>> = {
      createPatient,
      getPatientById, 
      updatePatient,
      searchPatients,
      searchPractitionersByName,
      createPractitioner,
      getPractitionerById,
      updatePractitioner,
      searchPractitioners,
      createOrganization,
      getOrganizationById,
      updateOrganization,
      searchOrganizations,
      createEncounter,
      getEncounterById,
      updateEncounter,
      searchEncounters,
      createObservation,
      getObservationById,
      updateObservation,
      searchObservations,
      createMedicationRequest,
      getMedicationRequestById,
      updateMedicationRequest,
      searchMedicationRequests,
      createMedication,
      getMedicationById,
      searchMedications,
      createEpisodeOfCare,
      getEpisodeOfCareById,
      updateEpisodeOfCare,
      searchEpisodesOfCare,
      createCondition,
      getConditionById,
      updateCondition,
      searchConditions,
      generalFhirSearch,
    };
  • TypeScript interface defining the input criteria structure expected by the searchPractitioners handler.
    export interface PractitionerSearchCriteria {
      identifier?: string; // Search by identifier (e.g., NPI)
      name?: string;       // General name search
      givenName?: string;
      familyName?: string;
      addressCity?: string;
      addressState?: string;
      telecom?: string;
      _lastUpdated?: string;
      // Add other relevant criteria as needed
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions search functionality but fails to describe key behaviors: whether it returns a list or single result, pagination handling, error conditions, or performance characteristics like rate limits. This is inadequate for a search tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary details. It could be slightly improved by structuring to highlight key points, but it avoids redundancy and waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a search tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It lacks information on return values, error handling, and behavioral traits, which are critical for effective tool use. The schema covers parameters well, but other aspects are underspecified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description lists example criteria ('name, specialty, or identifier'), which aligns with some parameters in the schema. However, with 100% schema description coverage, the schema already fully documents all 5 parameters. The description adds minimal value beyond the schema, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('searches for') and resource ('practitioners'), and specifies search criteria ('based on various criteria like name, specialty, or identifier'). However, it does not explicitly differentiate from the sibling tool 'searchPractitionersByName', which appears to be a more specific version. This omission prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as the sibling 'searchPractitionersByName' or 'getPractitionerById'. It lacks context about use cases, prerequisites, or exclusions, leaving the agent without direction on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/rkirkendall/medplum-mcp'

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