Skip to main content
Glama

expand_hierarchy

Expand an ICD-10-CM code to retrieve all more specific descendant codes in the billing hierarchy, enabling complete value set generation from a single seed code.

Instructions

Expand an ICD-10-CM code to every code beneath it in the billing hierarchy.

For example, expanding "E11" (Type 2 diabetes mellitus) returns all of its more specific subtypes, such as "E11.21" (with diabetic nephropathy). Every returned concept is tagged generated provenance: it is a structural consequence of the vocabulary hierarchy, not a clinically validated inclusion, and should be treated as ungrounded until a human confirms it belongs in the target population.

:param seed_code: An exact ICD-10-CM code to expand from, e.g. "E11". :returns: All descendant concepts, or an empty set if seed_code does not exist or has no descendants. :rtype: ConceptSet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seed_codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
conceptsNo
unmappableNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations present, the description carries full behavioral disclosure. It warns that returned concepts are tagged 'generated' provenance, are structural rather than clinically validated, and should be treated as ungrounded until human confirmation. It also states the empty-set behavior for nonexistent codes.

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 well structured and front-loaded: purpose, concrete example, critical provenance caveat, then parameter/return documentation. Every sentence adds value and there is no filler.

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?

For a single-parameter tool with no annotations, the description covers the purpose, the seed_code semantics, the return type and behavior, and an important caveat about generated concepts. This is complete enough for an agent to select and invoke the tool correctly.

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

Parameters4/5

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

The input schema only defines seed_code as a string with 0% coverage, so the description must compensate. It does so by specifying 'An exact ICD-10-CM code' and providing the E11 example, communicating the precision and format expectations. It could add period-format guidance, but it is sufficient.

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 precise action and resource: 'Expand an ICD-10-CM code to every code beneath it in the billing hierarchy.' The E11 to E11.21 example makes the operation concrete and distinguishes it from sibling tools like lookup_concept or search_concepts.

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 use case is clearly implied: call this when you need all descendants of an exact ICD-10-CM code. The description does not explicitly name alternatives or exclusion conditions, so it falls short of a perfect 5, but the framing leaves little ambiguity about when it applies.

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

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/colbyw5/phenoforge'

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