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_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. Dates show when Glama detected each change.

  1. 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"
      +}
  2. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already mark this as read-only and non-destructive. The description adds useful behavioral context beyond that: results are paginated, codes are distinct, and each result includes the raw chargemaster description and hospital count. No contradiction with annotations.

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 sentences with no filler. The first sentence front-loads what the tool returns and how it paginates; the second gives the use case and alternatives. Every clause earns its place.

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 read-only listing tool with a full output schema, fully documented parameters, and clear annotations, this description is complete. It tells the agent what the tool returns, how results are paginated, and when to invoke it relative to sibling tools.

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%, so the schema already documents all four parameters. The description reinforces code_type and pagination conceptually, but it does not add parameter-level meaning beyond what the schema provides, so the baseline of 3 is 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?

The description states a specific verb and resource: 'Returns every distinct code catalogued under a given code_type.' It also names sibling tools that do price lookups, clearly distinguishing this code-discovery tool from them.

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?

It explicitly says when to use this tool: 'Use this to discover which codes exist under a code system... before looking up prices.' It names the alternatives get_hospital_chargemaster_cost and list_hospital_code_costs, so an agent knows exactly how to route.

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.