Skip to main content
Glama

List hospital costs for a billing code

list_hospital_code_costs
Read-only

Returns cost stats for every hospital with a matching chargemaster entry for a code_type/code. Use this instead of calling get_hospital_chargemaster_cost once per hospital when comparing prices for the same procedure across hospitals (e.g. "which hospital has the cheapest MS-DRG 652?"). Defaults to returning every matching hospital (currently at most a few hundred) in one call. If the response's next_page_token is non-empty, the result set was truncated: call this tool again passing that exact value as page_token to get the next page, and keep doing so until next_page_token is empty - do not stop after one page and conclude a hospital has no data for this code. The response's total_count field (total across all pages) can be compared against how many results you've accumulated so far as a completeness check.

Input Schema

NameRequiredDescriptionDefault
codeYes
queryNoOptional case-insensitive hospital-name search, applied to the hospitals that report the code and ranked like list_hospitals' query (exact name, name prefix, word-start, other substrings). Blank is treated as unset. total_count and next_page_token describe the matches only.
order_byNoResult ordering. Unspecified (default) is HOSPITAL_COST_ORDER_RELEVANCE when query is set and HOSPITAL_COST_ORDER_HOSPITAL_ID otherwise. Ties break by hospital_id ascending. SAMPLE_COUNT_DESC/ASC order by the guaranteed pricing sample size (sample_count_sum_min); AVG/MEDIAN/MIN/MAX_ASC/DESC order by that price statistic; the *_ASC orders list hospitals with a 0 value (no price filed) last. STD_DEV_ASC/DESC order by how widely a hospital's own filed prices for the code vary (across payers, plans and settings, so contract mix counts as well as pricing discipline; it grows with price level). COEFFICIENT_OF_VARIATION_ASC/DESC order by std dev / average price, comparable across hospitals and procedures. page_token is only valid with the same order_by it was issued for.
code_typeYesCode system the chargemaster/billing code belongs to, e.g. APR-DRG, CDM, CPT, HCPCS, MS-DRG, RC. Hospitals may also support additional proprietary code types not listed here.
page_sizeNoMaximum number of results to return. Defaults to 500 (covering every matching hospital in one call at the current registry size), capped at 500.
page_tokenNoOpaque token from a previous list_hospital_code_costs response's next_page_token field. Omit for the first page. Only valid with the same code_type/code/methodology/min_sample_count/query/order_by it was issued for.
methodologyNoPricing methodology. Omit to aggregate across all methodologies.
min_sample_countNoMinimum pricing sample size: only return hospitals whose price is backed by at least this many billing records (compared against the de-identified range's lower bound, so a '1 through 10' row counts as 1). 0 (default) disables the filter. Pass 1 to exclude hospitals with no real sample data at all (most filings report 0/0, indistinguishable from a genuine zero). total_count and next_page_token describe the filtered set. Negative values are rejected.

Output Schema

NameRequiredDescriptionDefault
resultsNoOne entry per hospital with a matching chargemaster entry for this code (its latest revision only) - hospitals with no data for this code are omitted, not returned with found=false.
total_countNoTotal number of matching results across all pages, not just this page's results.length. Compare against results.length (plus any prior pages) to confirm you have the complete set before concluding a hospital or code has no data.
next_page_tokenNoOpaque pagination token, empty when there are no more results.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / order_by
      Added value: +{
      +  "description": "Result ordering. Unspecified (default) is HOSPITAL_COST_ORDER_RELEVANCE when query is set and HOSPITAL_COST_ORDER_HOSPITAL_ID otherwise. Ties break by hospital_id ascending. SAMPLE_COUNT_DESC/ASC order by the guaranteed pricing sample size (sample_count_sum_min); AVG/MEDIAN/MIN/MAX_ASC/DESC order by that price statistic; the *_ASC orders list hospitals with a 0 value (no price filed) last. STD_DEV_ASC/DESC order by how widely a hospital's own filed prices for the code vary (across payers, plans and settings, so contract mix counts as well as pricing discipline; it grows with price level). COEFFICIENT_OF_VARIATION_ASC/DESC order by std dev / average price, comparable across hospitals and procedures. page_token is only valid with the same order_by it was issued for.",
      +  "enum": [
      +    "HOSPITAL_COST_ORDER_UNSPECIFIED",
      +    "HOSPITAL_COST_ORDER_HOSPITAL_ID",
      +    "HOSPITAL_COST_ORDER_RELEVANCE",
      +    "HOSPITAL_COST_ORDER_SAMPLE_COUNT_DESC",
      +    "HOSPITAL_COST_ORDER_SAMPLE_COUNT_ASC",
      +    "HOSPITAL_COST_ORDER_AVG_ASC",
      +    "HOSPITAL_COST_ORDER_AVG_DESC",
      +    "HOSPITAL_COST_ORDER_MEDIAN_ASC",
      +    "HOSPITAL_COST_ORDER_MEDIAN_DESC",
      +    "HOSPITAL_COST_ORDER_MIN_ASC",
      +    "HOSPITAL_COST_ORDER_MIN_DESC",
      +    "HOSPITAL_COST_ORDER_MAX_ASC",
      +    "HOSPITAL_COST_ORDER_MAX_DESC",
      +    "HOSPITAL_COST_ORDER_STD_DEV_ASC",
      +    "HOSPITAL_COST_ORDER_STD_DEV_DESC",
      +    "HOSPITAL_COST_ORDER_COEFFICIENT_OF_VARIATION_ASC",
      +    "HOSPITAL_COST_ORDER_COEFFICIENT_OF_VARIATION_DESC"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / page_token / description
      Previous value: -"Opaque token from a previous list_hospital_code_costs response's next_page_token field. Omit for the first page. Only valid with the same code_type/code/methodology/min_sample_count it was issued for."New value: +"Opaque token from a previous list_hospital_code_costs response's next_page_token field. Omit for the first page. Only valid with the same code_type/code/methodology/min_sample_count/query/order_by it was issued for."
    • addedInput schema / properties / query
      Added value: +{
      +  "description": "Optional case-insensitive hospital-name search, applied to the hospitals that report the code and ranked like list_hospitals' query (exact name, name prefix, word-start, other substrings). Blank is treated as unset. total_count and next_page_token describe the matches only.",
      +  "type": "string"
      +}
  2. Changed6 schema fields changed
    • changedOutput schema / properties / results / items / properties / results / items / properties / cost / properties / sample_count_sum_max / description
      Previous value: -"Upper bound on the summed CMS sample-remittance count across contributing payer rows. Equal to sample_count_sum_min unless a de-identified '1 through 10' row narrowed it to a range."New value: +"Upper bound on the summed CMS sample-remittance count across contributing payer rows, as a decimal string (int64 - see protoLoaderOptions.longs). Equal to sample_count_sum_min unless a de-identified '1 through 10' row narrowed it to a range."
    • changedOutput schema / properties / results / items / properties / results / items / properties / cost / properties / sample_count_sum_max / type
      Previous value: -"integer"New value: +"string"
    • changedOutput schema / properties / results / items / properties / results / items / properties / cost / properties / sample_count_sum_min / description
      Previous value: -"Lower bound on the summed CMS sample-remittance count across contributing payer rows. Equal to sample_count_sum_max unless a de-identified '1 through 10' row narrowed it to a range."New value: +"Lower bound on the summed CMS sample-remittance count across contributing payer rows, as a decimal string (int64 - see protoLoaderOptions.longs). Equal to sample_count_sum_max unless a de-identified '1 through 10' row narrowed it to a range."
    • changedOutput schema / properties / results / items / properties / results / items / properties / cost / properties / sample_count_sum_min / type
      Previous value: -"integer"New value: +"string"
    • changedOutput schema / properties / results / items / properties / results / items / properties / cost / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
    • changedOutput schema / properties / results / items / properties / results / items / properties / description / type
      Previous value: -"object"New value: +[
      +  "object",
      +  "null"
      +]
  3. Changed2 schema fields changed
    • addedInput schema / properties / min_sample_count
      Added value: +{
      +  "description": "Minimum pricing sample size: only return hospitals whose price is backed by at least this many billing records (compared against the de-identified range's lower bound, so a '1 through 10' row counts as 1). 0 (default) disables the filter. Pass 1 to exclude hospitals with no real sample data at all (most filings report 0/0, indistinguishable from a genuine zero). total_count and next_page_token describe the filtered set. Negative values are rejected.",
      +  "type": "integer"
      +}
    • changedInput schema / properties / page_token / description
      Previous value: -"Opaque token from a previous list_hospital_code_costs response's next_page_token field. Omit for the first page. Do not pass any other value (e.g. an offset or cursor you construct yourself) here."New value: +"Opaque token from a previous list_hospital_code_costs response's next_page_token field. Omit for the first page. Only valid with the same code_type/code/methodology/min_sample_count it was issued for."
  4. Changed3 schema fields changed
    • addedOutput schema / properties / results / items / properties / results / items / properties / cost / properties / sample_count_exact
      Added value: +{
      +  "description": "True iff sample_count_sum_min == sample_count_sum_max, i.e. no contributing row was a de-identified '1 through 10' range.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / results / items / properties / results / items / properties / cost / properties / sample_count_sum_max
      Added value: +{
      +  "description": "Upper bound on the summed CMS sample-remittance count across contributing payer rows. Equal to sample_count_sum_min unless a de-identified '1 through 10' row narrowed it to a range.",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / results / items / properties / results / items / properties / cost / properties / sample_count_sum_min
      Added value: +{
      +  "description": "Lower bound on the summed CMS sample-remittance count across contributing payer rows. Equal to sample_count_sum_max unless a de-identified '1 through 10' row narrowed it to a range.",
      +  "type": "integer"
      +}
  5. Changed4 schema fields changed
    • removedOutput schema / properties / results / items / properties / cost
      Removed value: -{
      -  "properties": {
      -    "avg": {
      -      "type": "string"
      -    },
      -    "code": {
      -      "type": "string"
      -    },
      -    "code_type": {
      -      "type": "string"
      -    },
      -    "max": {
      -      "type": "string"
      -    },
      -    "median": {
      -      "type": "string"
      -    },
      -    "min": {
      -      "type": "string"
      -    },
      -    "std_dev": {
      -      "type": "string"
      -    }
      -  },
      -  "type": "object"
      -}
    • removedOutput schema / properties / results / items / properties / description
      Removed value: -{
      -  "properties": {
      -    "code_description": {
      -      "type": "string"
      -    },
      -    "hospital_name": {
      -      "type": "string"
      -    },
      -    "location": {
      -      "type": "string"
      -    },
      -    "methodology_note": {
      -      "type": "string"
      -    }
      -  },
      -  "type": "object"
      -}
    • changedOutput schema / properties / results / items / properties / found / description
      Previous value: -"Whether a matching chargemaster cost record was found."New value: +"True if at least one entry in results was found."
    • addedOutput schema / properties / results / items / properties / results
      Added value: +{
      +  "description": "One entry per requested methodology, in request order - or, when the methodology filter was left empty, exactly one aggregate entry.",
      +  "items": {
      +    "properties": {
      +      "cost": {
      +        "properties": {
      +          "avg": {
      +            "type": "string"
      +          },
      +          "code": {
      +            "type": "string"
      +          },
      +          "code_type": {
      +            "type": "string"
      +          },
      +          "max": {
      +            "type": "string"
      +          },
      +          "median": {
      +            "type": "string"
      +          },
      +          "min": {
      +            "type": "string"
      +          },
      +          "std_dev": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "description": {
      +        "properties": {
      +          "code_description": {
      +            "type": "string"
      +          },
      +          "hospital_name": {
      +            "type": "string"
      +          },
      +          "location": {
      +            "type": "string"
      +          },
      +          "methodology_note": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "found": {
      +        "description": "Whether a matching chargemaster cost record was found for this methodology.",
      +        "type": "boolean"
      +      },
      +      "methodology": {
      +        "description": "Methodology this entry is scoped to. Empty when aggregated across all methodologies (the request's methodology filter was left empty).",
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  6. Changed3 schema fields changed
    • changedInput schema / properties / page_size / description
      Previous value: -"Maximum number of results to return. Defaults to 20, capped at 100."New value: +"Maximum number of results to return. Defaults to 500 (covering every matching hospital in one call at the current registry size), capped at 500."
    • changedInput schema / properties / page_token / description
      Previous value: -"Opaque token from a previous list_hospital_code_costs response. Omit for the first page."New value: +"Opaque token from a previous list_hospital_code_costs response's next_page_token field. Omit for the first page. Do not pass any other value (e.g. an offset or cursor you construct yourself) here."
    • addedOutput schema / properties / total_count
      Added value: +{
      +  "description": "Total number of matching results across all pages, not just this page's results.length. Compare against results.length (plus any prior pages) to confirm you have the complete set before concluding a hospital or code has no data.",
      +  "type": "integer"
      +}
  7. Added

TDQS

A4.4/5.0
Behavior4/5

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

The read-only, non-destructive annotations already establish the safety profile, and the output schema covers return structure. The description adds meaningful behavioral context beyond that: results default to all matching hospitals, responses may be truncated with next_page_token, and total_count can be used as a completeness check.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with purpose and the key alternative to get_hospital_chargemaster_cost, then moves into pagination behavior and completeness checking. It is somewhat long, but the length is justified by the pagination and comparison guidance.

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?

Given the tool's complexity, rich input schema, existing output schema, and read-only annotations, the description covers the missing operational context: when to use it, how pagination works, and how to verify completeness. Nothing essential for correct invocation appears to be 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 high at 88%, so most parameter meaning is already documented in the input schema, including detailed order_by and pagination semantics. The description reinforces pagination usage and mentions total_count, but adds little parameter-level meaning beyond what the schema already provides.

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 cost stats for every hospital with a matching chargemaster entry for a code_type/code. It also distinguishes this from the sibling get_hospital_chargemaster_cost by explaining that this tool avoids calling that tool once per hospital when comparing the same procedure across hospitals.

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 to use this instead of calling get_hospital_chargemaster_cost once per hospital when comparing prices across hospitals, including a concrete example ("which hospital has the cheapest MS-DRG 652?"). It also gives clear pagination instructions: keep calling until next_page_token is empty and do not conclude a hospital has no data after one page.

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.