Discover FHIR server capabilities by reading and interpreting the CapabilityStatement
domain: hl7.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Send GET [base]/metadata with Accept: application/fhir+json to retrieve the CapabilityStatement resource
Inspect rest[0].resource array; each element describes a supported resource type with its supported interactions (read, search-type, create, etc.) listed in interaction[].code
Check rest[0].resource[*].searchParam for supported search parameters per resource type; use this to avoid sending unsupported parameters that will cause errors
Look for rest[0].operation to find supported operations such as $export, $everything, $summary, $match, or custom operations
Check rest[0].security for the SMART endpoint by looking for the OAuth URIs extension or by fetching .well-known/smart-configuration
Inspect fhirVersion to confirm the server's FHIR version (e.g., 4.0.1 for R4) and instantiates or implementationGuide to identify declared conformance to specific IGs
Known gotchas
CapabilityStatement may not be exhaustive; servers sometimes support undocumented parameters or operations — treat it as a minimum, not a complete inventory
The fhirVersion field is the FHIR spec version, not the API version; some servers use versioned base URLs (/fhir/r4/) which may also need to be detected from the server's documentation
SMART configuration is increasingly in .well-known/smart-configuration rather than the CapabilityStatement security extension; check both locations for compatibility with older and newer servers
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp