Skip to main content
Glama

List billing codes for a code type

list_codes
Read-only

Returns every distinct code catalogued under a given code_type, paginated, with each code's raw chargemaster description and the number of hospitals reporting it. Use this to discover which codes exist under a code system (e.g. all CPT codes) before looking up prices with get_hospital_chargemaster_cost or list_hospital_code_costs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortNoOrdering for the returned codes. CODE_SORT_UNSPECIFIED (default) sorts code-alphabetical. CODE_SORT_HOSPITAL_COUNT_DESC sorts most-hospitals-reporting first, for pre-sorted 'top codes' pages. CODE_SORT_SAMPLE_COUNT_DESC sorts by largest pricing sample size first (total_sample_count_max) - ranks by how many billing records actually back a code's pricing, rather than by how many hospitals merely report it. CODE_SORT_CODE_DESC is code-alphabetical, reverse order.
code_typeYesCode system to list codes for, e.g. "CPT". From list_code_types.
page_sizeNoMaximum number of results to return. Defaults to 500, capped at 500.
page_tokenNoOpaque token from a previous list_codes response. Omit for the first page.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
codesNo
total_countNoTotal number of matching codes across all pages.
next_page_tokenNoOpaque pagination token, empty when there are no more results.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / sort / description
      Previous value: -"Ordering for the returned codes. CODE_SORT_UNSPECIFIED (default) sorts code-alphabetical. CODE_SORT_HOSPITAL_COUNT_DESC sorts most-hospitals-reporting first, for pre-sorted 'top codes' pages."New value: +"Ordering for the returned codes. CODE_SORT_UNSPECIFIED (default) sorts code-alphabetical. CODE_SORT_HOSPITAL_COUNT_DESC sorts most-hospitals-reporting first, for pre-sorted 'top codes' pages. CODE_SORT_SAMPLE_COUNT_DESC sorts by largest pricing sample size first (total_sample_count_max) - ranks by how many billing records actually back a code's pricing, rather than by how many hospitals merely report it. CODE_SORT_CODE_DESC is code-alphabetical, reverse order."
    • changedInput schema / properties / sort / enum
      Previous value: -[
      -  "CODE_SORT_UNSPECIFIED",
      -  "CODE_SORT_HOSPITAL_COUNT_DESC"
      -]New value: +[
      +  "CODE_SORT_UNSPECIFIED",
      +  "CODE_SORT_HOSPITAL_COUNT_DESC",
      +  "CODE_SORT_SAMPLE_COUNT_DESC",
      +  "CODE_SORT_CODE_DESC"
      +]
    • addedOutput schema / properties / codes / items / properties / total_sample_count_exact
      Added value: +{
      +  "description": "True iff total_sample_count_min == total_sample_count_max, i.e. no contributing hospital's sample_count was a de-identified '1 through 10' range.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / codes / items / properties / total_sample_count_max
      Added value: +{
      +  "description": "Upper bound on the summed CMS sample-remittance count across every reporting hospital's contributing payer rows. Equal to total_sample_count_min unless a de-identified '1 through 10' row narrowed it to a range.",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / codes / items / properties / total_sample_count_min
      Added value: +{
      +  "description": "Lower bound on the summed CMS sample-remittance count across every reporting hospital's contributing payer rows. Equal to total_sample_count_max unless a de-identified '1 through 10' row narrowed it to a range.",
      +  "type": "integer"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / sort
      Added value: +{
      +  "description": "Ordering for the returned codes. CODE_SORT_UNSPECIFIED (default) sorts code-alphabetical. CODE_SORT_HOSPITAL_COUNT_DESC sorts most-hospitals-reporting first, for pre-sorted 'top codes' pages.",
      +  "enum": [
      +    "CODE_SORT_UNSPECIFIED",
      +    "CODE_SORT_HOSPITAL_COUNT_DESC"
      +  ],
      +  "type": "string"
      +}
  3. Added

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, non-destructive, and non-openWorld, so the safety profile is covered. The description adds pagination awareness and the fact that each code carries a raw description and hospital count, which is modestly useful, but the return-value details are also carried by the output schema, so added behavioral value is limited.

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?

Two tight sentences: the first delivers the return contract, the second the usage routing. The most decision-relevant scoping information is front-loaded with zero waste.

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?

An output schema exists, so return values need not be re-explained, and the description still covers pagination and the workflow position relative to siblings. For a read-only list tool with full schema coverage, nothing an agent needs to call it correctly is missing.

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%, including a fully documented sort enum and the code_type reference to list_code_types, so the schema does the heavy lifting. The description adds no parameter meaning beyond what the schema already provides, making the baseline 3 appropriate.

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?

Names a specific verb and resource ('Returns every distinct code catalogued under a given code_type') and explicitly lists the returned fields, so the agent knows exactly what this produces. It is clearly distinguishable from sibling tools like get_hospital_chargemaster_cost and list_hospital_code_costs.

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?

Explicitly states when to use it ('to discover which codes exist under a code system (e.g. all CPT codes)') and names the downstream alternatives it precedes ('before looking up prices with get_hospital_chargemaster_cost or list_hospital_code_costs'). This is a complete when-to-use and relationship statement.

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.