Send GET [base]/ValueSet/$validate-code?url=[valueSet-canonical]&system=[codeSystem]&code=[code] to the terminology server; alternatively POST with a Parameters body for more complex requests
Inspect the returned Parameters resource for the result parameter: a boolean true indicates the code is valid within the ValueSet, false indicates it is not
If result is false, read the message parameter for a human-readable explanation of why the code is invalid or not in the ValueSet
Optionally include display in the request to validate that the display string matches the code; the server returns a display parameter with the canonical display even if the submitted display differs
For FHIR resource validation workflows, call $validate-code for each coded element that must conform to a bound ValueSet before submitting the resource
Handle 400 errors for unknown code systems or ValueSets; check the OperationOutcome for whether the issue is an unknown system URL or an unsupported version
Known gotchas
$validate-code checks ValueSet membership, not just code system validity; a code valid in a code system may still fail ValueSet validation if the ValueSet binding excludes it
The url parameter refers to the ValueSet canonical URL, not a server-relative path; using a server id instead of the canonical URL may work on some servers but is not portable
Terminology servers may not have all code system versions loaded; a validation that succeeds on one server may fail on another if they have different version coverage — pin versions explicitly for consistency
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