io.github.cyanheads/medical-codes-mcp-server is an MCP server published by io.github.cyanheads, hosted at medical-codes.caseyjhand.com. When last checked on 2026-11-23 it was working: it answers and lists its tools. It declares 6 tools, including medcode_get_code, medcode_search_codes, medcode_check_code, medcode_map_codes, medcode_browse_hierarchy.
Offline US medical code lookup and crosswalk — ICD-10-CM/PCS, HCPCS Level II, RxNorm. Keyless.
428 connections through 5 shared values. Tap any node.
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, and a code written in ICD-10-CM dotted form (`A01.00`) resolves to ICD-10-CM; 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. Each reply holds `structuredContent` and the text to 24,000 bytes apiece: codes are decoded in request order, and once one has resolved, a code that would carry the reply past that budget is returned unprocessed in `deferred` with every code after it, each as sent — trimmed when its padding alone carries it past 64 characters, and cut to its first 64 trimmed characters and `…` when it is longer than that once trimmed — re-call with `codes` set to `deferred` and the same `system` and `includeHierarchy` until no `deferred` comes back. Three kinds of code are never deferred and can carry a reply past the budget: the first code that resolves, returned whole; the codes before it; and the unresolved codes after the last one that resolves, so a re-call always holds a code that resolves. Only a batch where nothing resolves fails: with ambiguous_system and `candidateSystems` when every code exists in more than one bundled system, otherwise with no_codes_found. 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_map_codes, or medcode_browse_hierarchy outside ICD-10-PCS); an ICD-10-PCS table row's children are the complete codes that begin with it. The resolved `system` is echoed on every result for chaining into a billability check or a medcode_map_codes parents/children walk; a bare integer that resolves nowhere is named as a possible CPT / HCPCS Level I code, which is out of scope, except a bare 10/11-digit one, which is named as an NDC no bundled drug maps to; a value in ICD-9-CM form — a dotted all-digit code (`250.00`, `00.1`) or an external-cause code (`E880.9`) — resolves in no bundled system and is named as ICD-9-CM, which is not bundled; an ICD-10-PCS section value from medcode_browse_hierarchy (`0`) looked up under system ICD10PCS is named as a section, not a code; 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.
None yet. Changes appear after a server's second daily check.
Squares are this server's values; dots are other servers sharing them. A shared address or publisher is a lead, not proof of a common operator.
Inferred from the host name and headers: what a server runs on, not who runs it.
| Parameter | Type | Description |
|---|---|---|
| codes * | array | Codes 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. |
| system | string | Force every code to be looked up in this system, which also skips the NDC decode. Omit to auto-detect per code. |
| includeHierarchy | boolean | When true, attach each found code's parent and immediate children. |
{
"name": "medcode_get_code",
"title": "Get Medical Code",
"description": "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, and a code written in ICD-10-CM dotted form (`A01.00`) resolves to ICD-10-CM; 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. Each reply holds `structuredContent` and the text to 24,000 bytes apiece: codes are decoded in request order, and once one has resolved, a code that would carry the reply past that budget is returned unprocessed in `deferred` with every code after it, each as sent — trimmed when its padding alone carries it past 64 characters, and cut to its first 64 trimmed characters and `…` when it is longer than that once trimmed — re-call with `codes` set to `deferred` and the same `system` and `includeHierarchy` until no `deferred` comes back. Three kinds of code are never deferred and can carry a reply past the budget: the first code that resolves, returned whole; the codes before it; and the unresolved codes after the last one that resolves, so a re-call always holds a code that resolves. Only a batch where nothing resolves fails: with ambiguous_system and `candidateSystems` when every code exists in more than one bundled system, otherwise with no_codes_found. 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_map_codes, or medcode_browse_hierarchy outside ICD-10-PCS); an ICD-10-PCS table row's children are the complete codes that begin with it. The resolved `system` is echoed on every result for chaining into a billability check or a medcode_map_codes parents/children walk; a bare integer that resolves nowhere is named as a possible CPT / HCPCS Level I code, which is out of scope, except a bare 10/11-digit one, which is named as an NDC no bundled drug maps to; a value in ICD-9-CM form — a dotted all-digit code (`250.00`, `00.1`) or an external-cause code (`E880.9`) — resolves in no bundled system and is named as ICD-9-CM, which is not bundled; an ICD-10-PCS section value from medcode_browse_hierarchy (`0`) looked up under system ICD10PCS is named as a section, not a code; 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.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"codes"
],
"properties": {
"codes": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"description": "A single code to decode (with or without dots), an RXCUI, or an NDC. Must not be blank or whitespace-only. A value longer than 64 characters once trimmed is longer than any bundled code, so it is not looked up and lands in notFound."
},
"maxItems": 50,
"minItems": 1,
"description": "Codes 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."
},
"system": {
"enum": [
"ICD10CM",
"ICD10PCS",
"HCPCS",
"RXNORM"
],
"type": "string",
"description": "Force every code to be looked up in this system, which also skips the NDC decode. Omit to auto-detect per code."
},
"includeHierarchy": {
"type": "boolean",
"default": false,
"description": "When true, attach each found code's parent and immediate children."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"found",
"notFound"
]
},
{
"required": [
"error"
]
}
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"examples": [
"no_codes_found",
"ambiguous_system"
],
"description": "Machine-readable failure mode. Declared by this tool: `no_codes_found`: None of the requested codes resolved — in any bundled system, or in the explicit `system` when one is given. The message names each code another bundled system holds and each code present in more than one system, with those systems, and each ICD-10-PCS section value, bare integer, value in ICD-9-CM form, NDC, and value too long to be any code among the misses. `ambiguous_system`: Every requested code is present in more than one bundled system and no `system` was given; `candidateSystems` lists the union of those systems. Other values are possible when a failure originates below the handler."
},
"recovery": {
"type": "object",
"required": [
"hint"
],
"properties": {
"hint": {
"type": "string"
}
},
"description": "Actionable next step for the caller.",
"additionalProperties": {}
},
"retryable": {
"type": "boolean",
"description": "Whether retrying may succeed."
}
},
"additionalProperties": {}
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
}
},
"description": "Present when the call failed. Absent on success.",
"additionalProperties": {}
},
"found": {
"type": "array",
"items": {
"type": "object",
"required": [
"system",
"code",
"description",
"shortDescription",
"billable",
"header",
"chapter"
],
"properties": {
"code": {
"type": "string",
"description": "The resolved code in display form (ICD-10-CM codes carry the dot, e.g. \"E11.9\")."
},
"header": {
"type": "boolean",
"description": "True when the code is a non-billable header with codes below it — an ICD-10-CM category, a HCPCS range bucket, or a three-character ICD-10-PCS table row — rather than a leaf code."
},
"parent": {
"type": [
"string",
"null"
],
"description": "Immediate parent code, always one medcode_get_code decodes (present only when includeHierarchy is true): an ICD-10-CM code padded with the placeholder X names the nearest code above the padding (`S82.66XA` → `S82.66`), and a complete ICD-10-PCS code names its three-character table row (`0DTJ4ZZ` → `0DT`). Null at a root — an ICD-10-CM category, a HCPCS range bucket, an ICD-10-PCS table row — and for RxNorm."
},
"source": {
"type": "string",
"description": "Resolution provenance when the input was not a direct code: \"NDC\" when an NDC was decoded to its RxNorm product via the NDC↔RxNorm map. Omitted for direct code lookups."
},
"system": {
"type": "string",
"description": "The system that answered: \"ICD10CM\", \"ICD10PCS\", \"HCPCS\", or \"RXNORM\". Pass it as `system` to medcode_check_code, or to medcode_map_codes on a parents/children walk; the map_codes drug directions accept only \"RXNORM\", which they need no `system` to reach."
},
"chapter": {
"type": [
"string",
"null"
],
"description": "Chapter/range bucket the code belongs to, or null when not applicable. For RxNorm, the concept term type (IN, PIN, MIN, BN, SCD, SBD, GPCK, BPCK)."
},
"billable": {
"type": [
"boolean",
"null"
],
"description": "True when the code is a billable leaf. False for headers/categories, non-billable codes, and HCPCS codes whose last valid date has passed. Null when the system has no billing concept (RxNorm)."
},
"children": {
"type": "array",
"items": {
"type": "object",
"required": [
"system",
"code",
"description",
"shortDescription",
"billable",
"header",
"chapter"
],
"properties": {
"code": {
"type": "string",
"description": "The resolved code in display form (ICD-10-CM codes carry the dot, e.g. \"E11.9\")."
},
"header": {
"type": "boolean",
"description": "True when the code is a non-billable header with codes below it — an ICD-10-CM category, a HCPCS range bucket, or a three-character ICD-10-PCS table row — rather than a leaf code."
},
"system": {
"type": "string",
"description": "The system that answered: \"ICD10CM\", \"ICD10PCS\", \"HCPCS\", or \"RXNORM\". Pass it as `system` to medcode_check_code, or to medcode_map_codes on a parents/children walk; the map_codes drug directions accept only \"RXNORM\", which they need no `system` to reach."
},
"chapter": {
"type": [
"string",
"null"
],
"description": "Chapter/range bucket the code belongs to, or null when not applicable. For RxNorm, the concept term type (IN, PIN, MIN, BN, SCD, SBD, GPCK, BPCK)."
},
"billable": {
"type": [
"boolean",
"null"
],
"description": "True when the code is a billable leaf. False for headers/categories, non-billable codes, and HCPCS codes whose last valid date has passed. Null when the system has no billing concept (RxNorm)."
},
"description": {
"type": [
"string",
"null"
],
"description": "Official long description (falls back to the short description when no long form exists)."
},
"shortDescription": {
"type": [
"string",
"null"
],
"description": "Official short/abbreviated description, or null when none is on record. Always null for RxNorm, which publishes a single name."
}
},
"description": "A decoded code with its official descriptions and derived flags.",
"additionalProperties": false
},
"description": "Immediate child codes (present only when includeHierarchy is true). For an ICD-10-PCS table row, the complete codes that begin with it."
},
"description": {
"type": [
"string",
"null"
],
"description": "Official long description (falls back to the short description when no long form exists)."
},
"alsoInSystems": {
"type": "array",
"items": {
"type": "string"
},
"description": "Other bundled systems holding this same code string, present only when there is at least one. The result above is the system this code resolved in; the code is a DIFFERENT code in each system listed here — \"B00\" is the ICD-10-CM category \"Herpesviral [herpes simplex] infections\" and also the ICD-10-PCS table row \"Imaging, Central Nervous System, Plain Radiography\". Re-call with `system` set to one of these values to decode it there."
},
"shortDescription": {
"type": [
"string",
"null"
],
"description": "Official short/abbreviated description, or null when none is on record. Always null for RxNorm, which publishes a single name."
},
"childrenTruncated": {
"type": "boolean",
"description": "True when the code has more immediate children than `children` carries — the list was capped at the server cap (present only when includeHierarchy is true). Retrieve the full child list with medcode_map_codes (children) for this code, passing its `system`, or medcode_browse_hierarchy outside ICD-10-PCS."
}
},
"description": "A decoded code, optionally with its parent/children and resolution source.",
"additionalProperties": false
},
"description": "Successfully decoded codes, in request order."
},
"deferred": {
"type": "array",
"items": {
"type": "string"
},
"description": "Input codes not processed because the reply reached its byte budget, in request order, each as sent — trimmed when its padding alone carries it past 64 characters, and its first 64 trimmed characters and \"…\" when it is longer than that once trimmed, which a re-call misses with the notFound entry this call would have given it. Re-call with these as codes and the same system and includeHierarchy, until no deferred comes back. Absent when every code was processed."
},
"notFound": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"reason"
],
"properties": {
"code": {
"type": "string",
"description": "The input code that could not be resolved, as sent — trimmed when its padding alone carries it past 64 characters, and its first 64 trimmed characters and \"…\" when it is longer than that once trimmed."
},
"reason": {
"type": "string",
"description": "Why it could not be resolved (absent from every bundled system — for a bare integer, with a note that CPT / HCPCS Level I codes are out of scope, and for a value in ICD-9-CM form such as \"250.00\", \"00.1\", or \"E880.9\", with a note that ICD-9-CM is not bundled — absent from the explicit `system` while another bundled system holds it, which is named, an ICD-10-PCS section value looked up as a code under system ICD10PCS, which is named as that section, a well-formed NDC nothing maps to, hyphenated or as bare 10/11 digits, an NDC looked up under an explicit `system` that skips the NDC decode, ambiguous across systems, or longer than any bundled code — over 64 characters once trimmed — and so not looked up, a reason naming neither the value nor its length)."
},
"candidateSystems": {
"type": "array",
"items": {
"type": "string"
},
"description": "When ambiguous, the systems whose shape/content the code matched — re-call with one as `system`."
}
},
"description": "An input code that did not resolve, with the reason it failed.",
"additionalProperties": false
},
"description": "Codes that did not resolve, with per-code reasons."
}
},
"additionalProperties": false
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}Find US medical codes whose official descriptions match a described concept, via full-text search over the bundled index. Every search term must appear — matched first as a token prefix, then as a substring so inflected and compound forms are also found (a "neuropathy" search surfaces "mononeuropathy"/"polyneuropathy" siblings too, not only a standalone "neuropathy" token). An RxNorm concept matches on its drug name alone, never its term type (SBD, IN, …) — narrow by type with `chapter`. Filter by `system` (ICD10CM/ICD10PCS/HCPCS/RXNORM), `billableOnly` to exclude headers/categories and terminated HCPCS codes, and `chapter`. Use when you have a clinical description and need the code — the reverse of medcode_get_code. Results echo the resolved system per row for chaining, rank exact prefix matches ahead of substring-only matches with a deterministic tie-break, and disclose truncation with a `nextCursor`: pass it back as `cursor` to page through the full ranked set.
| Parameter | Type | Description |
|---|---|---|
| limit | integer | Max codes per page. Defaults to the server's MEDCODE_MAX_RESULTS (50), ceiling 200. |
| query * | string | Clinical description to match, e.g. "type 2 diabetes with neuropathy". Must not be blank or whitespace-only. A search applies at most its first 1,000 distinct terms (a repeated term counts once); past that, `notice` says how many distinct terms the query carried and that the rest were not applied. |
| cursor | string | Opaque continuation token from a previous response's `nextCursor`, to fetch the next page of the same ranked result set. Omit for the first page. |
| system | string | Restrict results to one system. Omit to search all bundled systems. |
| chapter | string | Restrict to a chapter/range bucket (the value from a code's `chapter` field). Case-insensitive: surrounding whitespace is trimmed and the value is upper-cased to match how chapters are stored, and `appliedFilters.chapter` echoes the upper-cased value that actually ran, cut to its first 64 characters… |
| billableOnly | boolean | When true, return only billable leaf codes (exclude headers/categories and HCPCS codes whose last valid date has passed). RxNorm has no billing concept, so this excludes every RxNorm concept. |
{
"name": "medcode_search_codes",
"title": "Search Medical Codes",
"description": "Find US medical codes whose official descriptions match a described concept, via full-text search over the bundled index. Every search term must appear — matched first as a token prefix, then as a substring so inflected and compound forms are also found (a \"neuropathy\" search surfaces \"mononeuropathy\"/\"polyneuropathy\" siblings too, not only a standalone \"neuropathy\" token). An RxNorm concept matches on its drug name alone, never its term type (SBD, IN, …) — narrow by type with `chapter`. Filter by `system` (ICD10CM/ICD10PCS/HCPCS/RXNORM), `billableOnly` to exclude headers/categories and terminated HCPCS codes, and `chapter`. Use when you have a clinical description and need the code — the reverse of medcode_get_code. Results echo the resolved system per row for chaining, rank exact prefix matches ahead of substring-only matches with a deterministic tie-break, and disclose truncation with a `nextCursor`: pass it back as `cursor` to page through the full ranked set.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"query"
],
"properties": {
"limit": {
"type": "integer",
"maximum": 200,
"minimum": 1,
"description": "Max codes per page. Defaults to the server's MEDCODE_MAX_RESULTS (50), ceiling 200."
},
"query": {
"type": "string",
"minLength": 1,
"description": "Clinical description to match, e.g. \"type 2 diabetes with neuropathy\". Must not be blank or whitespace-only. A search applies at most its first 1,000 distinct terms (a repeated term counts once); past that, `notice` says how many distinct terms the query carried and that the rest were not applied."
},
"cursor": {
"type": "string",
"description": "Opaque continuation token from a previous response's `nextCursor`, to fetch the next page of the same ranked result set. Omit for the first page."
},
"system": {
"enum": [
"ICD10CM",
"ICD10PCS",
"HCPCS",
"RXNORM"
],
"type": "string",
"description": "Restrict results to one system. Omit to search all bundled systems."
},
"chapter": {
"type": "string",
"description": "Restrict to a chapter/range bucket (the value from a code's `chapter` field). Case-insensitive: surrounding whitespace is trimmed and the value is upper-cased to match how chapters are stored, and `appliedFilters.chapter` echoes the upper-cased value that actually ran, cut to its first 64 characters and \"…\" past that length. A blank or whitespace-only value carries no filtering intent and is treated as omitted, which the response discloses as `appliedFilters.chapter: null`."
},
"billableOnly": {
"type": "boolean",
"default": false,
"description": "When true, return only billable leaf codes (exclude headers/categories and HCPCS codes whose last valid date has passed). RxNorm has no billing concept, so this excludes every RxNorm concept."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"codes",
"effectiveQuery",
"appliedFilters",
"truncated",
"shown",
"cap"
]
},
{
"required": [
"error"
]
}
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"cap": {
"type": "number",
"description": "The page size that was applied."
},
"codes": {
"type": "array",
"items": {
"type": "object",
"required": [
"system",
"code",
"description",
"shortDescription",
"billable",
"header",
"chapter"
],
"properties": {
"code": {
"type": "string",
"description": "The code in display form (ICD-10-CM carries the dot)."
},
"header": {
"type": "boolean",
"description": "True when the code is a non-billable category/header."
},
"system": {
"type": "string",
"description": "The system the code belongs to, echoed for chaining."
},
"chapter": {
"type": [
"string",
"null"
],
"description": "Chapter/range bucket, or null. For RxNorm, the concept term type (IN, PIN, MIN, BN, SCD, SBD, GPCK, BPCK)."
},
"billable": {
"type": [
"boolean",
"null"
],
"description": "True when the code is a billable leaf. False for headers/categories, non-billable codes, and HCPCS codes whose last valid date has passed. Null when the system has no billing concept (RxNorm)."
},
"description": {
"type": [
"string",
"null"
],
"description": "Official long description (falls back to short when no long form exists)."
},
"shortDescription": {
"type": [
"string",
"null"
],
"description": "Official short description, or null when none is on record. Always null for RxNorm, which publishes a single name."
}
},
"description": "A code matching the search query.",
"additionalProperties": false
},
"description": "Matching codes, ranked by full-text relevance."
},
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"description": "Machine-readable failure mode."
},
"recovery": {
"type": "object",
"required": [
"hint"
],
"properties": {
"hint": {
"type": "string"
}
},
"description": "Actionable next step for the caller.",
"additionalProperties": {}
},
"retryable": {
"type": "boolean",
"description": "Whether retrying may succeed."
}
},
"additionalProperties": {}
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
}
},
"description": "Present when the call failed. Absent on success.",
"additionalProperties": {}
},
"shown": {
"type": "number",
"description": "Number of codes returned on this page."
},
"notice": {
"type": "string",
"description": "Guidance whenever a page returns no codes, naming which cause applies: nothing matched — it echoes the query and suggests how to broaden, or names `billableOnly` as the cause when the searched system has no billing concept — or the `cursor` starts past the last page of a query that does match. When the query carried more than 1,000 distinct terms, it leads with that limit and says the terms past it were not applied."
},
"truncated": {
"type": "boolean",
"description": "True when more matches exist beyond this page."
},
"nextCursor": {
"type": "string",
"description": "Opaque token to pass back as `cursor` for the next page. Present only when more matches exist beyond this page."
},
"appliedFilters": {
"type": "object",
"required": [
"system",
"billableOnly",
"chapter"
],
"properties": {
"system": {
"type": [
"string",
"null"
],
"description": "System filter applied, or null."
},
"chapter": {
"type": [
"string",
"null"
],
"description": "Chapter filter applied, or null — its first 64 characters and \"…\" when it is longer than that, though the whole value ran."
},
"billableOnly": {
"type": "boolean",
"description": "Whether the billable-only filter was applied."
}
},
"description": "Filters the server applied to the search.",
"additionalProperties": false
},
"effectiveQuery": {
"type": "string",
"description": "The query as the server parsed it for matching."
}
},
"additionalProperties": false
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}Validate whether a US medical code exists, is current, and is billable in the active bundled release. Returns a discriminated status — valid_billable, valid_not_billable, valid_header, valid, or terminated — with a `whyNot` explaining non-billable and terminated cases (e.g. "valid ICD-10-CM category but not billable — submit a more specific child code"). A HCPCS code is terminated once its last valid date has passed; before then it checks as billable, with that date in `whyNot`. This is the detail a coder needs before submitting a claim. RxNorm has no billing concept, so a current RxNorm concept is `valid` with `billable: null` and no billing verdict. Auto-detects the system from the code's shape, and a code written in ICD-10-CM dotted form (`A01.00`) resolves to ICD-10-CM; pass an explicit `system` to disambiguate. A non-billable or terminated code is a successful result with a whyNot, not an error — only a code absent from the named system, or with no `system` from every bundled system, raises unknown_code, which names the other bundled system that holds the code, or every system the code's shape fits. A value in ICD-9-CM form — a dotted all-digit code (`250.00`, `00.1`) or an external-cause code (`E880.9`) — resolves in no bundled system, with or without `system`, and its miss says ICD-9-CM is not bundled; an ICD-10-PCS section value from medcode_browse_hierarchy (`0`) checked under system ICD10PCS is named as a section, not a code. A code string that also exists in another bundled system carries `alsoInSystems` naming it, since the verdict applies only to the system that answered.
| Parameter | Type | Description |
|---|---|---|
| code * | string | The code to validate, with or without dots. Must not be blank or whitespace-only. A value longer than 64 characters once trimmed is longer than any bundled code, so it is not looked up and fails with unknown_code, which echoes its first 64 trimmed characters and "…" with its length. |
| system | string | Force the lookup into this system. Omit to auto-detect from the code's shape. |
{
"name": "medcode_check_code",
"title": "Check Medical Code",
"description": "Validate whether a US medical code exists, is current, and is billable in the active bundled release. Returns a discriminated status — valid_billable, valid_not_billable, valid_header, valid, or terminated — with a `whyNot` explaining non-billable and terminated cases (e.g. \"valid ICD-10-CM category but not billable — submit a more specific child code\"). A HCPCS code is terminated once its last valid date has passed; before then it checks as billable, with that date in `whyNot`. This is the detail a coder needs before submitting a claim. RxNorm has no billing concept, so a current RxNorm concept is `valid` with `billable: null` and no billing verdict. Auto-detects the system from the code's shape, and a code written in ICD-10-CM dotted form (`A01.00`) resolves to ICD-10-CM; pass an explicit `system` to disambiguate. A non-billable or terminated code is a successful result with a whyNot, not an error — only a code absent from the named system, or with no `system` from every bundled system, raises unknown_code, which names the other bundled system that holds the code, or every system the code's shape fits. A value in ICD-9-CM form — a dotted all-digit code (`250.00`, `00.1`) or an external-cause code (`E880.9`) — resolves in no bundled system, with or without `system`, and its miss says ICD-9-CM is not bundled; an ICD-10-PCS section value from medcode_browse_hierarchy (`0`) checked under system ICD10PCS is named as a section, not a code. A code string that also exists in another bundled system carries `alsoInSystems` naming it, since the verdict applies only to the system that answered.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"code"
],
"properties": {
"code": {
"type": "string",
"minLength": 1,
"description": "The code to validate, with or without dots. Must not be blank or whitespace-only. A value longer than 64 characters once trimmed is longer than any bundled code, so it is not looked up and fails with unknown_code, which echoes its first 64 trimmed characters and \"…\" with its length."
},
"system": {
"enum": [
"ICD10CM",
"ICD10PCS",
"HCPCS",
"RXNORM"
],
"type": "string",
"description": "Force the lookup into this system. Omit to auto-detect from the code's shape."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"system",
"code",
"status",
"billable",
"whyNot"
]
},
{
"required": [
"error"
]
}
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"code": {
"type": "string",
"description": "The code in display form (ICD-10-CM carries the dot)."
},
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"examples": [
"unknown_code",
"ambiguous_system"
],
"description": "Machine-readable failure mode. Declared by this tool: `unknown_code`: The code does not exist in the named system, or with no `system` in any bundled system. `ambiguous_system`: The code is present in more than one bundled system and no `system` was given. Other values are possible when a failure originates below the handler."
},
"recovery": {
"type": "object",
"required": [
"hint"
],
"properties": {
"hint": {
"type": "string"
}
},
"description": "Actionable next step for the caller.",
"additionalProperties": {}
},
"retryable": {
"type": "boolean",
"description": "Whether retrying may succeed."
}
},
"additionalProperties": {}
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
}
},
"description": "Present when the call failed. Absent on success.",
"additionalProperties": {}
},
"status": {
"enum": [
"valid_billable",
"valid_not_billable",
"valid_header",
"valid",
"terminated"
],
"type": "string",
"description": "Validity status. valid_billable = submit as-is; valid_header/valid_not_billable = needs a more specific code; valid = exists and is current in a system with no billing concept (RxNorm), so there is no billing verdict; terminated = retired — its last valid date has passed."
},
"system": {
"type": "string",
"description": "The system the code was resolved in, echoed for chaining."
},
"whyNot": {
"type": [
"string",
"null"
],
"description": "Explanation for non-billable/terminated statuses. On valid_billable, null unless the code is scheduled for termination, when it names the last date the code may be used. Null when valid."
},
"billable": {
"type": [
"boolean",
"null"
],
"description": "True only when status is valid_billable. Null when status is valid — the system has no billing concept."
},
"alsoInSystems": {
"type": "array",
"items": {
"type": "string"
},
"description": "Other bundled systems holding this same code string, present only when there is at least one. The verdict above is for the system this code resolved in; the code is a DIFFERENT code in each system listed here, with its own billability — \"B00\" is the ICD-10-CM category \"Herpesviral [herpes simplex] infections\" and also the ICD-10-PCS table row \"Imaging, Central Nervous System, Plain Radiography\". Re-call with `system` set to one of these values to validate it there."
}
},
"additionalProperties": false
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}Crosswalk a US medical code or drug across systems and within a hierarchy. Hierarchy directions: `parents` and `children` walk a code's hierarchy one level per call — immediate parent/children only (depth-1); call iteratively for the full ancestor or descendant path. ICD-10-CM and HCPCS walk the prefix hierarchy, stepping past an ICD-10-CM level padded with the placeholder X that is not itself a code (the parent of `S82.66XA` is `S82.66`); an ICD-10-PCS three-character table row's children are the complete codes that begin with it, and a complete code's parent is its table row; RxNorm concepts have no code hierarchy. A resolvable source with no edge in the requested direction is a successful empty result with a notice, not an error. A source code string that also exists in another bundled system carries `alsoInSystems` naming it, since only the resolved system's hierarchy was walked. Drug directions (RxNorm): `name_to_rxcui` (drug name → RXCUI; one name matches ingredients, combinations, and products alike, each hit tagged with its `conceptType`), `ndc_to_rxcui` and `rxcui_to_ndc` (NDC ↔ RXCUI; NDCs accepted 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; `ndc_to_rxcui` names the product it decoded to and its `conceptType`), `rxcui_to_ingredients` and `rxcui_to_brands` (RXCUI → ingredient/brand RXCUIs, each with the target's RxNorm name and its `conceptType` — read that before counting a combination product's ingredients). Drug-class directions (RxClass): `rxcui_to_classes` (RXCUI → its classes: pharmacologic class, mechanism of action, physiologic effect, pharmacokinetics, therapeutic category, chemical structure, the diseases it may treat, prevent, diagnose, or induce or is contraindicated with, VA class, DEA controlled-substance schedule, CDC vaccine code; a drug product also carries its ingredients' classes, naming the ingredient in `via`, while DEA schedules are recorded only on drug products and VA classes almost only there, so map a product for those) and `class_to_rxcuis` (class ID → its direct member RXCUIs, each with its RxNorm name and `conceptType`). Each class hit carries `classType`, `source` (the RxClass source asserting it), and `relation` — a `ci_` relation is a contraindication, not an indication; narrow either direction with `classType`. Every result carries `source` provenance (which system or edge answered) so a chained call (e.g. into openfda with a resolved NDC) uses the right identifier. The `children`, `name_to_rxcui`, `rxcui_to_ndc`, `rxcui_to_classes`, and `class_to_rxcuis` directions can return large sets and paginate: a `nextCursor` in the response is passed back as `cursor` (with an optional `limit` page size) to walk the full set. A field the direction does not use is rejected with `field_not_applicable`: `limit` and `cursor` on the point directions, `classType` outside the class directions, and a `system` other than RXNORM on the drug and class directions.
| Parameter | Type | Description |
|---|---|---|
| from * | string | The source value: a code (for parents/children), a drug name, an NDC, an RXCUI, or an RxClass class ID (for class_to_rxcuis). Must not be blank or whitespace-only. A drug name is looked up whole at any length; on every other direction a value longer than 64 characters once trimmed is longer than any… |
| limit | integer | Max results per page, for the paginated directions only (children, name_to_rxcui, rxcui_to_ndc, rxcui_to_classes, class_to_rxcuis). Defaults to MEDCODE_MAX_RESULTS (50), ceiling 200. Rejected on every other direction. |
| cursor | string | Opaque continuation token from a previous response's `nextCursor`, for the paginated directions only (children, name_to_rxcui, rxcui_to_ndc, rxcui_to_classes, class_to_rxcuis). Omit for the first page; an empty string counts as omitted. A non-empty cursor on any other direction is rejected. |
| system | string | For parents/children, force the source code into this system. Omit to auto-detect. The drug and class directions resolve in RxNorm and accept only "RXNORM" (no effect); any other value there is rejected. |
| classType | string | For rxcui_to_classes and class_to_rxcuis only: keep only classes of this RxClass type — EPC (FDA established pharmacologic class), MOA (mechanism of action), PE (physiologic effect), PK (pharmacokinetics), TC (therapeutic category), CHEM (chemical structure), DISEASE (diseases the drug may treat, pr… |
| direction * | string | What to map to. parents/children return the immediate parent or children only (depth-1) — call iteratively to walk a full path; the rxcui/ndc/name directions are RxNorm drug crosswalks; rxcui_to_classes and class_to_rxcuis are RxClass drug-class crosswalks. |
{
"name": "medcode_map_codes",
"title": "Map Medical Codes",
"description": "Crosswalk a US medical code or drug across systems and within a hierarchy. Hierarchy directions: `parents` and `children` walk a code's hierarchy one level per call — immediate parent/children only (depth-1); call iteratively for the full ancestor or descendant path. ICD-10-CM and HCPCS walk the prefix hierarchy, stepping past an ICD-10-CM level padded with the placeholder X that is not itself a code (the parent of `S82.66XA` is `S82.66`); an ICD-10-PCS three-character table row's children are the complete codes that begin with it, and a complete code's parent is its table row; RxNorm concepts have no code hierarchy. A resolvable source with no edge in the requested direction is a successful empty result with a notice, not an error. A source code string that also exists in another bundled system carries `alsoInSystems` naming it, since only the resolved system's hierarchy was walked. Drug directions (RxNorm): `name_to_rxcui` (drug name → RXCUI; one name matches ingredients, combinations, and products alike, each hit tagged with its `conceptType`), `ndc_to_rxcui` and `rxcui_to_ndc` (NDC ↔ RXCUI; NDCs accepted 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; `ndc_to_rxcui` names the product it decoded to and its `conceptType`), `rxcui_to_ingredients` and `rxcui_to_brands` (RXCUI → ingredient/brand RXCUIs, each with the target's RxNorm name and its `conceptType` — read that before counting a combination product's ingredients). Drug-class directions (RxClass): `rxcui_to_classes` (RXCUI → its classes: pharmacologic class, mechanism of action, physiologic effect, pharmacokinetics, therapeutic category, chemical structure, the diseases it may treat, prevent, diagnose, or induce or is contraindicated with, VA class, DEA controlled-substance schedule, CDC vaccine code; a drug product also carries its ingredients' classes, naming the ingredient in `via`, while DEA schedules are recorded only on drug products and VA classes almost only there, so map a product for those) and `class_to_rxcuis` (class ID → its direct member RXCUIs, each with its RxNorm name and `conceptType`). Each class hit carries `classType`, `source` (the RxClass source asserting it), and `relation` — a `ci_` relation is a contraindication, not an indication; narrow either direction with `classType`. Every result carries `source` provenance (which system or edge answered) so a chained call (e.g. into openfda with a resolved NDC) uses the right identifier. The `children`, `name_to_rxcui`, `rxcui_to_ndc`, `rxcui_to_classes`, and `class_to_rxcuis` directions can return large sets and paginate: a `nextCursor` in the response is passed back as `cursor` (with an optional `limit` page size) to walk the full set. A field the direction does not use is rejected with `field_not_applicable`: `limit` and `cursor` on the point directions, `classType` outside the class directions, and a `system` other than RXNORM on the drug and class directions.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"from",
"direction"
],
"properties": {
"from": {
"type": "string",
"minLength": 1,
"description": "The source value: a code (for parents/children), a drug name, an NDC, an RXCUI, or an RxClass class ID (for class_to_rxcuis). Must not be blank or whitespace-only. A drug name is looked up whole at any length; on every other direction a value longer than 64 characters once trimmed is longer than any bundled code, so it is not looked up and fails with no_mapping. A miss or notice echoes at most its first 64 trimmed characters and \"…\", with its length."
},
"limit": {
"type": "integer",
"maximum": 200,
"minimum": 1,
"description": "Max results per page, for the paginated directions only (children, name_to_rxcui, rxcui_to_ndc, rxcui_to_classes, class_to_rxcuis). Defaults to MEDCODE_MAX_RESULTS (50), ceiling 200. Rejected on every other direction."
},
"cursor": {
"type": "string",
"description": "Opaque continuation token from a previous response's `nextCursor`, for the paginated directions only (children, name_to_rxcui, rxcui_to_ndc, rxcui_to_classes, class_to_rxcuis). Omit for the first page; an empty string counts as omitted. A non-empty cursor on any other direction is rejected."
},
"system": {
"enum": [
"ICD10CM",
"ICD10PCS",
"HCPCS",
"RXNORM"
],
"type": "string",
"description": "For parents/children, force the source code into this system. Omit to auto-detect. The drug and class directions resolve in RxNorm and accept only \"RXNORM\" (no effect); any other value there is rejected."
},
"classType": {
"enum": [
"EPC",
"MOA",
"PE",
"PK",
"TC",
"CHEM",
"DISEASE",
"VA",
"SCHEDULE",
"CVX"
],
"type": "string",
"description": "For rxcui_to_classes and class_to_rxcuis only: keep only classes of this RxClass type — EPC (FDA established pharmacologic class), MOA (mechanism of action), PE (physiologic effect), PK (pharmacokinetics), TC (therapeutic category), CHEM (chemical structure), DISEASE (diseases the drug may treat, prevent, diagnose, or induce, or is contraindicated with), VA (VA drug class, recorded almost only on drug products), SCHEDULE (DEA controlled-substance schedule, recorded on drug products only), CVX (CDC vaccine code). Omit for every type. Rejected on every other direction."
},
"direction": {
"enum": [
"parents",
"children",
"name_to_rxcui",
"ndc_to_rxcui",
"rxcui_to_ndc",
"rxcui_to_ingredients",
"rxcui_to_brands",
"rxcui_to_classes",
"class_to_rxcuis"
],
"type": "string",
"description": "What to map to. parents/children return the immediate parent or children only (depth-1) — call iteratively to walk a full path; the rxcui/ndc/name directions are RxNorm drug crosswalks; rxcui_to_classes and class_to_rxcuis are RxClass drug-class crosswalks."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"from",
"direction",
"resolvedSystem",
"hits"
]
},
{
"required": [
"error"
]
}
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"cap": {
"type": "number",
"description": "Paginated directions only: the page size that was applied."
},
"from": {
"type": "string",
"description": "The source value, echoed back."
},
"hits": {
"type": "array",
"items": {
"type": "object",
"required": [
"source",
"system",
"value"
],
"properties": {
"via": {
"type": "string",
"description": "On `rxcui_to_classes` hits only: the ingredient RXCUI a drug product inherits this class through — RxClass attaches most classes to ingredients. Absent when the class attaches to the source RXCUI itself. When several ingredients carry the same class, names an ingredient (\"IN\") over its precise ingredient (\"PIN\"), then the lowest RXCUI."
},
"value": {
"type": "string",
"description": "The mapped target value (a code, RXCUI, NDC, or RxClass class ID)."
},
"source": {
"type": "string",
"description": "Which system or relationship edge produced this hit (e.g. \"ICD10CM\", \"has_ingredient\", \"NDC\"). On the class directions, the RxClass source asserting the drug–class edge: \"MEDRT\" (VA MED-RT), \"FDASPL\" (FDA structured product labels), \"FMTSME\" (Federal Medication Terminologies), \"VA\" (VA National Formulary classes), \"RXNORM\" (DEA schedules as RxNorm records them), or \"CDC\" (CVX vaccine codes)."
},
"system": {
"type": [
"string",
"null"
],
"description": "The code system of the target value, or null when the target is not a system code (an NDC, or an RxClass class ID)."
},
"relation": {
"type": "string",
"description": "The RxClass relationship between the drug and the class, on `rxcui_to_classes` and `class_to_rxcuis` hits only: has_epc, has_moa, has_pe, has_pk, site_of_metabolism, has_tc, has_ingredient / has_chemical_structure / has_active_metabolites (CHEM), may_treat / may_prevent / may_diagnose / induces (DISEASE), has_vaclass / has_vaclass_extended, has_schedule, isa_cvx. A `ci_` relation (ci_with, ci_moa, ci_pe, ci_chemclass) is a contraindication: the drug is contraindicated with that disease or class — never an indication, and never class membership."
},
"classType": {
"enum": [
"EPC",
"MOA",
"PE",
"PK",
"TC",
"CHEM",
"DISEASE",
"VA",
"SCHEDULE",
"CVX"
],
"type": "string",
"description": "The RxClass class type, on `rxcui_to_classes` and `class_to_rxcuis` hits only — the values the `classType` input takes."
},
"conceptType": {
"type": "string",
"description": "The target concept's RxNorm type, present on `name_to_rxcui`, `ndc_to_rxcui`, `rxcui_to_ingredients`, `rxcui_to_brands`, and `class_to_rxcuis` hits only. A drug-name match or a class member may be any drug concept: an ingredient type or brand name below, or a drug product — \"SCD\"/\"SBD\" (clinical/branded drug) or \"GPCK\"/\"BPCK\" (generic/branded pack), the four an `ndc_to_rxcui` hit always takes. Otherwise \"IN\" (ingredient), \"PIN\" (precise ingredient — a specific salt, ester, or isomer of an ingredient), \"MIN\" (multiple ingredients — a concept naming a combination, never a substance within it), or \"BN\" (brand name). Ingredient hits mix the first three, so the hit count is not the substance count: a \"MIN\" hit is the grouping concept and never counts, and a \"PIN\" names a form of a substance rather than an extra one — usually alongside the \"IN\" it refines, though two \"PIN\" esters can share a single \"IN\". Counting the \"IN\" hits is the closest reading, and under-counts those shared cases."
},
"description": {
"type": "string",
"description": "Description of the target when available: the code description for hierarchy hits, the official RxNorm name for the `name_to_rxcui`, `ndc_to_rxcui`, `rxcui_to_ingredients`, `rxcui_to_brands`, and `class_to_rxcuis` drug concepts, and the class name for `rxcui_to_classes`. Absent for `rxcui_to_ndc`, whose targets are package identifiers with no description of their own."
}
},
"description": "One crosswalk result tagged with the edge that produced it.",
"additionalProperties": false
},
"description": "Crosswalk results, each tagged with the edge that produced it."
},
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"examples": [
"field_not_applicable",
"no_mapping",
"direction_unavailable",
"ambiguous_system"
],
"description": "Machine-readable failure mode. Declared by this tool: `field_not_applicable`: A `system`, `classType`, `limit`, or `cursor` was sent on a direction that does not use it. `no_mapping`: The source value did not resolve to a bundled code, drug, or class the direction reads. The rxcui_to_* directions read RxNorm concepts only, and their miss names any other bundled system that holds the value. `direction_unavailable`: A drug-crosswalk direction was requested but this build carries no RxNorm tables, or a class direction was requested but it carries no RxClass class layer. `ambiguous_system`: The source code is present in more than one system and no `system` was given. Other values are possible when a failure originates below the handler."
},
"recovery": {
"type": "object",
"required": [
"hint"
],
"properties": {
"hint": {
"type": "string"
}
},
"description": "Actionable next step for the caller.",
"additionalProperties": {}
},
"retryable": {
"type": "boolean",
"description": "Whether retrying may succeed."
}
},
"additionalProperties": {}
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
}
},
"description": "Present when the call failed. Absent on success.",
"additionalProperties": {}
},
"shown": {
"type": "number",
"description": "Paginated directions only: number of hits returned on this page."
},
"notice": {
"type": "string",
"description": "Guidance whenever a resolvable source returns no hits, naming which of the two causes applies: it has no edge in the requested direction (a top-level code has no parent; a leaf has no children; an ICD-10-PCS table row has no parent; RxNorm concepts have no code hierarchy; no bundled class, or none of the requested `classType`, covers the RXCUI; a class has no direct member), or the `cursor` starts past the last page of a direction that does have results."
},
"direction": {
"type": "string",
"description": "The mapping direction that was applied."
},
"truncated": {
"type": "boolean",
"description": "Paginated directions (children, name_to_rxcui, rxcui_to_ndc, rxcui_to_classes, class_to_rxcuis) only: true when more results exist beyond this page."
},
"nextCursor": {
"type": "string",
"description": "Paginated directions only: opaque token to pass back as `cursor` for the next page. Present only when more results exist beyond this page."
},
"alsoInSystems": {
"type": "array",
"items": {
"type": "string"
},
"description": "Other bundled systems holding the same `from` code string, present only when there is at least one (hierarchy directions only — a drug name, NDC, or RXCUI is not system-scoped). The hits above were walked in `resolvedSystem` alone; the code is a DIFFERENT code with a different hierarchy in each system listed here — \"B00\" is the ICD-10-CM category \"Herpesviral [herpes simplex] infections\" and also the ICD-10-PCS table row \"Imaging, Central Nervous System, Plain Radiography\". Re-call with `system` set to one of these values to walk it there."
},
"resolvedSystem": {
"type": [
"string",
"null"
],
"description": "The system the source resolved in, or null when not system-scoped."
}
},
"additionalProperties": false
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}Walk a US medical code system's hierarchy for discovery without a search term. With no `node`, returns the top-level entries (ICD-10-CM categories, HCPCS range buckets, or ICD-10-PCS first-axis values). With a `node`, returns its immediate children. ICD-10-CM and HCPCS use a prefix hierarchy (a shorter code is the parent of a longer one); ICD-10-PCS is axis-based — each of its 7 characters is an independent axis (section, body system, root operation, body part, approach, device, qualifier), but only the top-level Section axis is browsable (omit `node`): positions 2–7 are context-dependent on the preceding axis path and are not enumerable from a flat partial code, so list the complete codes in a three-character ICD-10-PCS table row with medcode_map_codes (direction children) instead. Lets an agent orient in an unfamiliar system or enumerate a category's specific codes. A large child set paginates: when the response carries a `nextCursor`, pass it back as `cursor` to fetch the next page.
| Parameter | Type | Description |
|---|---|---|
| node | any | A node to expand — or omit / pass an empty string for the top level. For ICD-10-CM/HCPCS, a code whose children to list; ICD-10-PCS supports only top-level Section browsing. Must not be blank or whitespace-only when provided. A node longer than 64 characters once trimmed is longer than any bundled c… |
| limit | integer | Max entries per page. Defaults to MEDCODE_MAX_RESULTS (50), ceiling 200. |
| cursor | string | Opaque continuation token from a previous response's `nextCursor`, to fetch the next page of children/entries. Omit for the top of the list. |
| system * | string | The code system to browse. |
{
"name": "medcode_browse_hierarchy",
"title": "Browse Code Hierarchy",
"description": "Walk a US medical code system's hierarchy for discovery without a search term. With no `node`, returns the top-level entries (ICD-10-CM categories, HCPCS range buckets, or ICD-10-PCS first-axis values). With a `node`, returns its immediate children. ICD-10-CM and HCPCS use a prefix hierarchy (a shorter code is the parent of a longer one); ICD-10-PCS is axis-based — each of its 7 characters is an independent axis (section, body system, root operation, body part, approach, device, qualifier), but only the top-level Section axis is browsable (omit `node`): positions 2–7 are context-dependent on the preceding axis path and are not enumerable from a flat partial code, so list the complete codes in a three-character ICD-10-PCS table row with medcode_map_codes (direction children) instead. Lets an agent orient in an unfamiliar system or enumerate a category's specific codes. A large child set paginates: when the response carries a `nextCursor`, pass it back as `cursor` to fetch the next page.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"system"
],
"properties": {
"node": {
"anyOf": [
{
"type": "string",
"const": ""
},
{
"type": "string",
"minLength": 1,
"description": "A code whose children to list (ICD-10-CM/HCPCS). ICD-10-PCS supports only top-level Section browsing — a partial PCS code does not expand to next-position axis values."
}
],
"description": "A node to expand — or omit / pass an empty string for the top level. For ICD-10-CM/HCPCS, a code whose children to list; ICD-10-PCS supports only top-level Section browsing. Must not be blank or whitespace-only when provided. A node longer than 64 characters once trimmed is longer than any bundled code, so it is not looked up and fails with unknown_node (RxNorm, which has no hierarchy, answers empty for any node); a miss or notice echoes at most its first 64 trimmed characters and \"…\", with its length."
},
"limit": {
"type": "integer",
"maximum": 200,
"minimum": 1,
"description": "Max entries per page. Defaults to MEDCODE_MAX_RESULTS (50), ceiling 200."
},
"cursor": {
"type": "string",
"description": "Opaque continuation token from a previous response's `nextCursor`, to fetch the next page of children/entries. Omit for the top of the list."
},
"system": {
"enum": [
"ICD10CM",
"ICD10PCS",
"HCPCS",
"RXNORM"
],
"type": "string",
"description": "The code system to browse."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"kind",
"codes",
"axes",
"truncated",
"shown",
"cap"
]
},
{
"required": [
"error"
]
}
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"cap": {
"type": "number",
"description": "The page size that was applied."
},
"axes": {
"type": "array",
"items": {
"type": "object",
"required": [
"position",
"value",
"meaning"
],
"properties": {
"value": {
"type": "string",
"description": "The single-character axis value valid at this position."
},
"meaning": {
"type": "string",
"description": "What this axis value means at this position."
},
"position": {
"type": "number",
"description": "The 1-based character position in the ICD-10-PCS code."
}
},
"description": "A valid ICD-10-PCS axis value at a given character position.",
"additionalProperties": false
},
"description": "The top-level ICD-10-PCS Section axis values (only the Section axis is enumerable). Empty when kind is \"codes\"."
},
"kind": {
"enum": [
"codes",
"axes"
],
"type": "string",
"description": "\"codes\" for prefix-hierarchy children (ICD-10-CM/HCPCS); \"axes\" for ICD-10-PCS axis values."
},
"codes": {
"type": "array",
"items": {
"type": "object",
"required": [
"system",
"code",
"description",
"shortDescription",
"billable",
"header",
"chapter"
],
"properties": {
"code": {
"type": "string",
"description": "The child code in display form."
},
"header": {
"type": "boolean",
"description": "True when the code is a non-billable category/header."
},
"system": {
"type": "string",
"description": "The system the node belongs to."
},
"chapter": {
"type": [
"string",
"null"
],
"description": "Chapter/range bucket, or null."
},
"billable": {
"type": [
"boolean",
"null"
],
"description": "True when the code is a billable leaf. False for headers/categories, non-billable codes, and HCPCS codes whose last valid date has passed. Null when the system has no billing concept."
},
"description": {
"type": [
"string",
"null"
],
"description": "Official long description, or null."
},
"shortDescription": {
"type": [
"string",
"null"
],
"description": "Official short description, or null."
}
},
"description": "A child code in a prefix hierarchy (ICD-10-CM/HCPCS).",
"additionalProperties": false
},
"description": "Child codes under the requested node or top level. Empty when kind is \"axes\"."
},
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"examples": [
"unknown_node"
],
"description": "Machine-readable failure mode. Declared by this tool: `unknown_node`: The node does not exist in the system, including a node written as an ICD-9-CM code (`E880.9`, `00.1`), which no bundled system holds — for ICD-10-PCS, also when it uses a character outside the axis alphabet or begins no bundled code. Other values are possible when a failure originates below the handler."
},
"recovery": {
"type": "object",
"required": [
"hint"
],
"properties": {
"hint": {
"type": "string"
}
},
"description": "Actionable next step for the caller.",
"additionalProperties": {}
},
"retryable": {
"type": "boolean",
"description": "Whether retrying may succeed."
}
},
"additionalProperties": {}
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
}
},
"description": "Present when the call failed. Absent on success.",
"additionalProperties": {}
},
"shown": {
"type": "number",
"description": "Number of entries returned on this page (codes or axes)."
},
"notice": {
"type": "string",
"description": "Guidance when a node has no children/axes — suggests the top level or a valid node."
},
"truncated": {
"type": "boolean",
"description": "True when more entries exist beyond this page."
},
"nextCursor": {
"type": "string",
"description": "Opaque token to pass back as `cursor` for the next page. Present only when more entries exist beyond this page."
}
},
"additionalProperties": false
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}List the bundled US medical code systems with their release identifiers, effective dates, and code counts, and the RxClass drug-class layer the class crosswalks read, with each source’s version. Confirms which ICD-10-CM fiscal year, ICD-10-PCS fiscal year, HCPCS Level II release, RxNorm normalized set, and RxClass sources are active before acting on any decode, search, or crosswalk result. The corpus is offline and built at package-build time — this call reports exactly which release is baked into the running server. ICD-10-CM/PCS are the US clinical modifications, not the ICD-10/ICD-11 base.
No parameters.
{
"name": "medcode_list_systems",
"title": "List Code Systems",
"description": "List the bundled US medical code systems with their release identifiers, effective dates, and code counts, and the RxClass drug-class layer the class crosswalks read, with each source’s version. Confirms which ICD-10-CM fiscal year, ICD-10-PCS fiscal year, HCPCS Level II release, RxNorm normalized set, and RxClass sources are active before acting on any decode, search, or crosswalk result. The corpus is offline and built at package-build time — this call reports exactly which release is baked into the running server. ICD-10-CM/PCS are the US clinical modifications, not the ICD-10/ICD-11 base.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"anyOf": [
{
"not": {
"required": [
"error"
]
},
"required": [
"systems",
"classLayer"
]
},
{
"required": [
"error"
]
}
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": -9007199254740991,
"description": "JSON-RPC error code for this failure."
},
"data": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"description": "Machine-readable failure mode."
},
"recovery": {
"type": "object",
"required": [
"hint"
],
"properties": {
"hint": {
"type": "string"
}
},
"description": "Actionable next step for the caller.",
"additionalProperties": {}
},
"retryable": {
"type": "boolean",
"description": "Whether retrying may succeed."
}
},
"additionalProperties": {}
},
"message": {
"type": "string",
"description": "Human-readable description of what went wrong."
}
},
"description": "Present when the call failed. Absent on success.",
"additionalProperties": {}
},
"systems": {
"type": "array",
"items": {
"type": "object",
"required": [
"system",
"label",
"releaseId",
"effectiveStart",
"effectiveEnd",
"codeCount",
"sourceUrl",
"builtAt"
],
"properties": {
"label": {
"type": "string",
"description": "Human-readable system name, e.g. \"ICD-10-CM\"."
},
"system": {
"type": "string",
"description": "System identifier, e.g. \"ICD10CM\", \"ICD10PCS\", \"HCPCS\", \"RXNORM\"."
},
"builtAt": {
"type": "string",
"description": "ISO 8601 timestamp of this system’s data. For ICD-10-CM, ICD-10-PCS, and HCPCS, the time the index was built from the release named in `releaseId`. For RxNorm, which publishes no release label, the date the RxNav snapshot was fetched — how current its drug data is, unchanged by a rebuild from the same snapshot."
},
"codeCount": {
"type": "number",
"description": "Number of code rows bundled for this system."
},
"releaseId": {
"type": "string",
"description": "Release/version identifier baked into this build, e.g. \"ICD-10-CM FY2027\"."
},
"sourceUrl": {
"type": [
"string",
"null"
],
"description": "Canonical .gov source the release was built from, or null."
},
"effectiveEnd": {
"type": [
"string",
"null"
],
"description": "Last date this release is effective (YYYY-MM-DD), or null if open-ended."
},
"effectiveStart": {
"type": [
"string",
"null"
],
"description": "First date this release is effective (YYYY-MM-DD), or null if not recorded."
}
},
"description": "Provenance for one bundled code system.",
"additionalProperties": false
},
"description": "One entry per bundled code system, in canonical order — the systems the `system` inputs of the other tools accept."
},
"classLayer": {
"anyOf": [
{
"type": "object",
"required": [
"classCount",
"edgeCount",
"sourceUrl",
"sources"
],
"properties": {
"sources": {
"type": "array",
"items": {
"type": "object",
"required": [
"source",
"version",
"classCount",
"edgeCount",
"fetchedAt"
],
"properties": {
"source": {
"type": "string",
"description": "The RxClass source, as class hits carry it in `source`: MEDRT, FDASPL, FMTSME, VA, RXNORM (DEA schedules), or CDC (CVX)."
},
"version": {
"type": [
"string",
"null"
],
"description": "The release RxClass reports for this source, or null when it publishes none."
},
"edgeCount": {
"type": "number",
"description": "Drug–class edges this source contributes."
},
"fetchedAt": {
"type": "string",
"description": "ISO 8601 date the RxClass snapshot was fetched — how current the class edges are."
},
"classCount": {
"type": "number",
"description": "Classes this source asserts at least one bundled edge to."
}
},
"description": "Provenance for one bundled RxClass source.",
"additionalProperties": false
},
"description": "One entry per bundled RxClass source."
},
"edgeCount": {
"type": "number",
"description": "Drug–class edges bundled, across every source."
},
"sourceUrl": {
"type": "string",
"description": "The RxClass API the layer was fetched from."
},
"classCount": {
"type": "number",
"description": "RxClass class nodes bundled, including hierarchy nodes with no direct member."
}
},
"additionalProperties": false
},
{
"type": "null"
}
],
"description": "The RxClass drug-class layer the rxcui_to_classes and class_to_rxcuis directions of medcode_map_codes read — not a code system, so it has no entry in `systems`. Null when this build carries no class layer."
}
},
"additionalProperties": false
},
"annotations": {
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true
}
}Offline US healthcare code lookup and crosswalk over a bundled SQLite index — keyless, no rate limit, deterministic. Bundled systems: ICD-10-CM (diagnoses), ICD-10-PCS (inpatient procedures), HCPCS Level II (supplies/drugs/services), and RxNorm drugs (the current normalized set). Decode a code with medcode_get_code (the 80% entry point; accepts a batch, auto-detects the system per code, and decodes an NDC directly to its RxNorm product). Go description → code with medcode_search_codes. Validate billability with medcode_check_code — a non-billable or terminated code is a successful result with a whyNot, not an error. RxNorm has no billing concept: its concepts carry billable: null and check as valid, with no billing verdict. Walk the hierarchy with medcode_browse_hierarchy (prefix for ICD-10-CM/HCPCS; ICD-10-PCS browses only its top-level sections, so list the complete PCS codes in a three-character table row such as 0DT with medcode_map_codes children, or find PCS codes with medcode_search_codes). Crosswalk with medcode_map_codes — code parents/children, the RxNorm drug directions (drug name → RXCUI, NDC ↔ RXCUI, RXCUI → ingredients/brands), and the RxClass drug-class directions (RXCUI → classes: pharmacologic class, mechanism, physiologic effect, indications and contraindications, VA class, DEA schedule, vaccine code; class ID → member RXCUIs). A class hit whose relation starts with ci_ is a contraindication, not an indication. DEA schedules are recorded only on drug products, and VA classes almost only there, so map a product rather than an ingredient for those. Confirm which releases and RxClass sources are active with medcode_list_systems. ICD-10-CM/PCS are the US clinical modifications, not the ICD-10/ICD-11 base.
Names, descriptions and schemas were written by the server and are shown as data.
Shared addresses on big platforms (Cloudflare, Vercel and the like) put unrelated servers together; those are marked shared_infrastructure. A match is a pivot, not a link between operators.