Skip to main content
Glama

medical-codes-mcp-server

medcode_get_code
Read-onlyIdempotent

Decode one or more US medical codes to their official descriptions across ICD-10-CM (diagnoses), ICD-10-PCS (inpatient procedures), HCPCS Level II (supplies/drugs/services), and RxNorm (drugs, by RXCUI). Also decodes a National Drug Code (NDC) directly to its RxNorm product offline, tagged source: "NDC" — hyphenated in an FDA segment configuration (4-4-2, 5-3-2, 5-4-1, or the 11-digit 5-4-2) or as bare 10/11 digits; any other segment widths are malformed and stay unresolved. Auto-detects the system from each code's shape; pass an explicit system only when a value is genuinely ambiguous. Accepts 1–50 codes and returns partial success: resolved codes in found, unresolved in notFound with a per-code reason, so one bad code never fails the batch. Set includeHierarchy to attach each code's parent and immediate children (with a childrenTruncated flag when a code has more children than the cap returns — walk the full set via medcode_browse_hierarchy or medcode_map_codes). The resolved system is echoed on every result for chaining into medcode_map_codes or a billability check; a code string that also exists in another bundled system carries alsoInSystems naming it, so a single answer to a colliding code is never mistaken for the only one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codesYesCodes to decode (1–50). Mixed systems are fine — each is detected independently. An NDC decodes to its RxNorm product: hyphenated as 4-4-2, 5-3-2, 5-4-1, or 5-4-2, or as bare 10/11 digits.
systemNoForce every code to be looked up in this system. Omit to auto-detect per code.
includeHierarchyNoWhen true, attach each found code's parent and immediate children.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
foundNoSuccessfully decoded codes, in request order.
notFoundNoCodes that did not resolve, with per-code reasons.

TDQS

A5/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=true, idempotentHint=true, openWorldHint=false), the description discloses critical runtime behavior: partial success with `found` and `notFound` fields and per-code reasons, malformed NDC handling, auto-detection, the `childrenTruncated` flag, and the `alsoInSystems` collision signal. It also explains the impact of `includeHierarchy` and how to walk the full set. This goes well beyond the annotations, giving an agent a precise mental model of the tool's behavior.

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

Conciseness5/5

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

The description is long but every sentence earns its place, covering the core action, NDC specifics, batch semantics, hierarchy option, collision handling, and chaining. It is front-loaded with the primary purpose, then branches into details. No redundant or filler language—each clause contributes to actionable understanding.

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?

Given the tool's complexity (multiple coding systems, NDC decoding, partial success, hierarchy, collisions) and the presence of an output schema, the description covers all necessary aspects: input constraints, optional parameters, edge cases, and secondary behavior. It even mentions the `alsoInSystems` field and the `childrenTruncated` flag, which are likely part of the output schema but are reinforced here. An agent can fully anticipate how to call the tool and interpret results without further inspection.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Even though the schema has 100% coverage with descriptions for each parameter, the description adds meaningful detail: it specifies exact NDC segment formats (4-4-2, 5-3-2, 5-4-1, 5-4-2, and bare 10/11 digits), clarifies that the `codes` array accepts mixed systems, and explains that `system` is only for forced lookups. This adds semantic value beyond the schema, particularly around edge cases and expected input formats.

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 opens with a specific verb and resource: 'Decode one or more US medical codes to their official descriptions' across multiple named systems (ICD-10-CM, ICD-10-PCS, HCPCS, RxNorm). It distinguishes itself from siblings by covering decoding specifically, and further differentiates NDC decoding as a unique behavior. The description is clearly about a batch decoding tool, not a search, map, browse, or check tool.

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

Usage Guidelines5/5

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

The description explicitly states when to pass the `system` parameter ('only when a value is genuinely ambiguous'), and directs users to alternatives for fuller hierarchy traversal ('walk the full set via medcode_browse_hierarchy or medcode_map_codes'). It also mentions chaining into medcode_map_codes or a billability check, providing actionable routing. This is clear, specific guidance that selects this tool over siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.7/5.0
Disambiguation5/5

Each tool serves a unique, non-overlapping function: browsing hierarchy, validating codes, decoding descriptions, listing systems, mapping between codes, and searching by clinical description. There is no ambiguity in selecting the right tool for a task.

Naming Consistency5/5

All tool names follow the 'medcode_' prefix with a clear verb_noun pattern: browse_hierarchy, check_code, get_code, list_systems, map_codes, search_codes. This is a perfectly consistent naming convention.

Tool Count5/5

With six tools, the server is well-scoped for its purpose of decoding, validating, searching, and crosswalking medical codes. Each tool covers a distinct essential capability, and the count feels appropriate for a focused domain.

Completeness5/5

The tool set covers the full read-only lifecycle: discovering codes (browse), searching (search), decoding (get), validating (check), crosswalking (map), and identifying release versions (list_systems). There are no obvious dead ends or missing operations for this domain.