Browse Code Hierarchy
medcode_browse_hierarchyWalk 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"system": "<system>"
},
"name": "medcode_browse_hierarchy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node | No | 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 | No | Max entries per page. Defaults to MEDCODE_MAX_RESULTS (50), ceiling 200. | |
| cursor | No | 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 | Yes | The code system to browse. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | The page size that was applied. | |
| axes | No | The top-level ICD-10-PCS Section axis values (only the Section axis is enumerable). Empty when kind is "codes". | |
| kind | No | "codes" for prefix-hierarchy children (ICD-10-CM/HCPCS); "axes" for ICD-10-PCS axis values. | |
| codes | No | Child codes under the requested node or top level. Empty when kind is "axes". | |
| error | No | Present when the call failed. Absent on success. | |
| shown | No | Number of entries returned on this page (codes or axes). | |
| notice | No | Guidance when a node has no children/axes — suggests the top level or a valid node. | |
| truncated | No | True when more entries exist beyond this page. | |
| nextCursor | No | Opaque token to pass back as `cursor` for the next page. Present only when more entries exist beyond this page. |