Skip to main content
Glama
rkirkendall

Medplum MCP Server

by rkirkendall

searchPractitionersByName

Locate medical practitioners by entering their first name, last name, or a general name string using the Medplum MCP Server's search functionality.

Instructions

Searches for medical practitioners based on their given name, family name, or a general name string.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
familyNameNoThe practitioner's family (last) name.
givenNameNoThe practitioner's given (first) name.
nameNoA general name search string for the practitioner.

Implementation Reference

  • Core handler function that searches for Practitioner FHIR resources by constructing search parameters from givenName, familyName, or name, authenticates via Medplum, and executes the search.
    export async function searchPractitionersByName(
      params: PractitionerNameSearchParams
    ): Promise<Practitioner[]> {
      await ensureAuthenticated();
    
      const searchCriteria: string[] = [];
      if (params.givenName) {
        searchCriteria.push(`given:contains=${params.givenName}`);
      }
      if (params.familyName) {
        searchCriteria.push(`family:contains=${params.familyName}`);
      }
      if (params.name) {
        searchCriteria.push(`name:contains=${params.name}`);
      }
    
      if (searchCriteria.length === 0) {
        return [];
      }
      const queryString = searchCriteria.join('&');
      return medplum.searchResources('Practitioner', queryString);
    }
  • MCP input schema definition for the searchPractitionersByName tool, specifying parameters for givenName, familyName, and name.
      name: "searchPractitionersByName",
      description: "Searches for medical practitioners based on their given name, family name, or a general name string.",
      inputSchema: {
        type: "object",
        properties: {
          givenName: {
            type: "string",
            description: "The practitioner's given (first) name.",
          },
          familyName: {
            type: "string",
            description: "The practitioner's family (last) name.",
          },
          name: {
            type: "string",
            description: "A general name search string for the practitioner.",
          },
        },
        required: [],
      },
    },
  • src/index.ts:950-988 (registration)
    Tool mapping registration that associates the 'searchPractitionersByName' string key with the imported handler function for execution during tool calls.
    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,
    };
  • src/index.ts:14-19 (registration)
    Import statement registering the searchPractitionersByName handler function from practitionerUtils into the main index file.
      searchPractitionersByName,
      createPractitioner,
      getPractitionerById,
      updatePractitioner,
      searchPractitioners,
    } from './tools/practitionerUtils.js';
  • Original tool schema definition for searchPractitionersByName (likely legacy, as MCP uses inline schemas in index.ts).
    export const toolSchemas = [
      {
        name: 'searchPractitionersByName',
        description: "Searches for medical practitioners (doctors, nurses, etc.) based on their given name, family name, or a general name string. Provide at least one name component.",
        input_schema: {
          type: 'object',
          properties: {
            givenName: {
              type: 'string',
              description: "The practitioner\'s given (first) name. Optional.",
            },
            familyName: {
              type: 'string',
              description: "The practitioner\'s family (last) name. Optional.",
            },
            name: {
              type: 'string',
              description: "A general name search string for the practitioner (e.g., \'Dr. John Smith\', \'Smith\'). Optional.",
            },
          },
          required: [], // Function logic handles requiring at least one param
        },
      },
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 describes the search functionality but lacks critical details: it doesn't specify if this is a read-only operation, how results are returned (e.g., pagination, format), error conditions, or performance characteristics like rate limits. For a search tool with zero annotation coverage, this is a significant gap.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded with the core purpose and uses clear terminology, making it easy to parse. Every part of the sentence earns its place by specifying the resource and search parameters.

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

Completeness3/5

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

Given the tool's moderate complexity (search operation with 3 parameters), no annotations, and no output schema, the description is minimally adequate. It covers the basic purpose but lacks details on behavior, usage context, and output format. Without annotations or output schema, the agent must rely on incomplete information, making this description just sufficient for a simple search but with clear gaps.

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?

Schema description coverage is 100%, meaning the input schema already fully documents the three parameters (familyName, givenName, name) with clear descriptions. The description adds minimal value by listing the search criteria but doesn't provide additional semantics beyond what's in the schema, such as search logic (e.g., partial matches, case sensitivity) or parameter interactions. Baseline 3 is appropriate when the schema does the heavy lifting.

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 tool's purpose: 'Searches for medical practitioners based on their given name, family name, or a general name string.' It specifies the verb ('searches'), resource ('medical practitioners'), and search criteria. However, it doesn't explicitly differentiate from sibling tools like 'searchPractitioners' or 'getPractitionerById', which is why it doesn't reach a score of 5.

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. It doesn't mention sibling tools such as 'searchPractitioners' (which might have broader search capabilities) or 'getPractitionerById' (for exact ID-based retrieval), nor does it specify prerequisites or exclusions. This lack of context leaves the agent to infer usage.

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