List billing codes for a code type
list_codesReturns 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. Pass query to text-search codes/descriptions instead of listing a whole code_type. Pass hospital_id to restrict results to codes that one hospital actually reports.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_codes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | 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 network-wide pricing sample size first (sample_count_max, always network-wide regardless of hospital_id) - 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_SORT_RELEVANCE ranks best text match first (exact code, then code prefix, then description word-start, then description substring), ties broken by network-wide sample count descending, and is only meaningful - and the default - when query is set; without a query it behaves like CODE_SORT_SAMPLE_COUNT_DESC. CODE_SORT_HOSPITAL_COUNT_ASC / CODE_SORT_SAMPLE_COUNT_ASC surface rare codes (fewest hospitals / smallest network-wide sample first; zero counts sort last). CODE_SORT_MEDIAN_PRICE_DESC/ASC order by the network-wide median price (CodeSummary.median_price) and CODE_SORT_PRICE_SPREAD_DESC by the widest hospital-to-hospital spread (price_spread); codes with no price sort last in every price order. Price figures are network-wide even when hospital_id is set, and blend billing classes, methodologies and settings. | |
| query | No | Case-insensitive text search: matches the code as a prefix, and substrings of the raw and AI-generated descriptions. Descriptions are only searched for queries of 4+ characters; shorter queries match the code prefix only. When set, code_type may be left empty to search across code types. | |
| code_type | No | Code system to list codes for, e.g. "CPT". From list_code_types. May be left empty when query is set, to search across code types (excluding hospital-specific CDM and LOCAL codes) - CodeSummary.code_type tells the hits apart in that case. | |
| page_size | No | Maximum number of results to return. Defaults to 500, capped at 500. | |
| page_token | No | Opaque token from a previous list_codes response. Omit for the first page. Only valid with the same query/code_type/sort it was issued for. | |
| hospital_id | No | Optional hospital scoping (a hospital_id from list_hospitals): restricts results to codes that hospital actually reports on its latest revision, and makes sample_count_min/max/exact that hospital's own sample size for the code rather than the network-wide total. Unset (default) is network-wide. page_token is only valid with the same hospital_id it was issued for, same as query/code_type/sort. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| codes | No | ||
| total_count | No | Total number of matching codes across all pages. | |
| next_page_token | No | Opaque pagination token, empty when there are no more results. |