Skip to main content
Glama

Validate Medical Codes

validate_codes
Read-onlyIdempotent

Validate medical codes against source terminologies to flag invalid codes, find ICD-10 to ICD-11 replacements, and check activity status for legacy database analysis.

Instructions

Validate a mixed batch of medical codes against their source terminologies. Useful for retrospective analysis of legacy databases — flag codes that no longer exist, surface ICD-10 → ICD-11 replacements, and grade activity status where the terminology exposes it.

For each input { code, terminology }, returns:

  • valid: whether the code exists in the source terminology.

  • active: whether the code is currently active. Null when the source doesn't expose an explicit active/inactive distinction at category level (CID-10, ATC, ICD-11, RxNorm, MeSH all return null today; SNOMED and LOINC return a real boolean).

  • title: the official label/name when available.

  • replaced_by: a successor code, populated today only for ICD-10 codes that have a primary ICD-11 mapping in the bundled WHO transition tables.

  • source: human-readable provenance of the validation (terminology + release/version).

  • error: non-null only when validation couldn't be performed (network error, SNOMED feature flag off, etc.). valid: false + error: null means "code not found"; valid: false + error: set means "couldn't validate".

Terminology is required per code — auto-detection isn't supported because category codes like "A00" exist in both ICD-10 and CID-10. Accepted values: icd11, icd10, snomed, loinc, rxnorm, mesh, atc, cid10.

Hard cap of 50 codes per call; codes are validated in parallel through their respective clients, so total wall time scales with the slowest upstream + its rate limit (worst case ~10 s for a full batch hitting ICD-11).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codesYesList of code+terminology pairs to validate. Hard cap of 50 per call to keep total latency under ~10 s given upstream rate limits.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
totalYesNumber of codes submitted.
resultsYes
provenanceYesOne provenance block per upstream source that contributed to this response (contract v1.0; licenses are never merged)
attributionYesCanonical source URLs of this response (attribution list)
error_countYesHow many couldn't be validated due to upstream/network errors.
valid_countYesHow many were confirmed valid.
invalid_countYesHow many were not found.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds rich behavioral detail beyond the annotations: it explains the exact return fields (valid, active, title, replaced_by, source, error), the semantics of active/null for different terminologies, and the error disambiguation ('valid: false + error: null' vs 'valid: false + error: set'). It also notes the hard cap and parallel execution with latency implications, and mentions the SNOMED feature flag. These are valuable context that annotations alone do not provide.

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

Conciseness4/5

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

The description is well-structured with a clear opening sentence, a use-case paragraph, a bulleted list of return fields, and notes on terminology and performance. It is appropriately detailed for a complex tool. It is slightly verbose, but every sentence contributes meaningful information, with no filler or redundancy.

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

Completeness5/5

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

The description is comprehensive given the tool's complexity. It covers the purpose, use cases, return value semantics, error handling, accepted terminologies, input requirements, and performance characteristics. The output schema exists but is not provided, so the detailed return-field documentation in the description is essential and fully covers what an agent needs to invoke and interpret results correctly.

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%, so the baseline is 3. The schema already documents the 'codes' array, the 'code' string, and the 'terminology' enum, including the rationale for required terminology and the 50-item cap. The description largely repeats these details (e.g., the same 'A00' example and cap rationale) without adding new parameter-specific semantics, so it earns the baseline rather than higher.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Validate a mixed batch of medical codes against their source terminologies.' It specifies the verb (validate), the resource (medical codes), and the scope (against source terminologies). It also distinguishes itself from siblings by focusing on batch validation across terminologies rather than lookup/search of individual codes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly gives a use case: 'Useful for retrospective analysis of legacy databases — flag codes that no longer exist, surface ICD-10 → ICD-11 replacements, and grade activity status.' It implies when not to use (e.g., for singular lookups, use the individual terminology search tools) but does not explicitly name alternatives or exclusions, so it misses the top score.

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

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/SidneyBissoli/medical-terminologies-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server