Skip to main content
Glama

searchOrganizations

Search for healthcare organizations by name or address using structured criteria. Designed for Medplum MCP Server to manage FHIR data efficiently through targeted queries.

Instructions

Searches for organizations based on criteria like name or address. Provide at least one criterion.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressNoPart of the organization's address to search for. Optional.
nameNoThe name of the organization to search for. Optional.

Implementation Reference

  • The handler function that builds FHIR search query parameters from input arguments and executes the search using Medplum client.
    export async function searchOrganizations(searchArgs: OrganizationSearchArgs): Promise<Organization[]> { await ensureAuthenticated(); const searchCriteria: string[] = []; if (searchArgs.name) { searchCriteria.push(`name=${encodeURIComponent(searchArgs.name)}`); } if (searchArgs.identifier) { searchCriteria.push(`identifier=${encodeURIComponent(searchArgs.identifier)}`); } if (searchArgs.type) { searchCriteria.push(`type=${encodeURIComponent(searchArgs.type)}`); } if (searchArgs.active !== undefined) { searchCriteria.push(`active=${searchArgs.active}`); } if (searchArgs.address) { searchCriteria.push(`address=${encodeURIComponent(searchArgs.address)}`); } if (searchArgs.city) { searchCriteria.push(`address-city=${encodeURIComponent(searchArgs.city)}`); } if (searchArgs.state) { searchCriteria.push(`address-state=${encodeURIComponent(searchArgs.state)}`); } if (searchArgs.postalCode) { searchCriteria.push(`address-postalcode=${encodeURIComponent(searchArgs.postalCode)}`); } if (searchArgs.country) { searchCriteria.push(`address-country=${encodeURIComponent(searchArgs.country)}`); } if (searchCriteria.length === 0) { return []; } const queryString = searchCriteria.join('&'); return medplum.searchResources("Organization", queryString); }
  • MCP tool schema defining the input parameters for the searchOrganizations tool.
    { name: "searchOrganizations", description: "Searches for organizations based on criteria like name or address. Provide at least one criterion.", inputSchema: { type: "object", properties: { name: { type: "string", description: "The name of the organization to search for. Optional.", }, address: { type: "string", description: "Part of the organization's address to search for. Optional.", }, }, required: [], }, },
  • src/index.ts:963-963 (registration)
    Registration of the searchOrganizations handler function in the toolMapping object used by the MCP server.
    searchOrganizations,
  • src/index.ts:21-25 (registration)
    Import of the searchOrganizations function into the main server file.
    createOrganization, getOrganizationById, updateOrganization, searchOrganizations, } from './tools/organizationUtils.js';
  • TypeScript schema definition for searchOrganizations tool (potentially legacy or supplementary).
    { name: 'searchOrganizations', description: "Searches for organizations based on criteria like name or address. Provide at least one criterion.", input_schema: { type: 'object', properties: { name: { type: 'string', description: "The name of the organization to search for. Optional." }, address: { type: 'string', description: "Part of the organization\'s address to search for. Optional." }, }, required: [], // Function logic ensures at least one is present },

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