Use FHIR terminology services to expand a ValueSet using the $expand operation against LOINC and validate a code using $validate-code against a SNOMED CT value set
Send GET [base]/ValueSet/[id]/$expand or POST with a ValueSet resource body to expand the value set; use the filter parameter to search for specific display terms and the count parameter to page results
Parse the returned expansion.contains array to extract system, code, display, and any designation extensions for each concept in the expanded set
Perform code validation with GET [base]/ValueSet/[id]/$validate-code?system=[uri]&code=[value]&display=[text] or POST with Parameters resource to verify a specific code is in the value set
Interpret the result Parameters resource: the result parameter (boolean) indicates validity, and the message parameter provides human-readable validation feedback
Use the $lookup operation on a CodeSystem (e.g., LOINC or RxNorm) to retrieve full concept details including properties, designations, and relationships for a given code
Known gotchas
Terminology servers may not host all code systems natively; LOINC and SNOMED CT require licensing agreements and many free terminology servers only include a subset of concepts
ValueSet expansion can be extremely large for broadly defined value sets like all SNOMED CT clinical findings; always use filter and count parameters to avoid response size issues
The canonical URL of a value set must match exactly what is registered on the terminology server; version suffixes in the URL can cause 404 errors even when the base value set exists
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