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. Served from the hospital-prices serving snapshot, which pools exactly (exact medians), so figures can differ slightly from earlier results of this tool. Like those, each figure still combines facility and professional charges (and all settings) into one number; use list_code_provider_hospitals for a per-billing-class breakdown instead. page_tokens from before this change are not valid.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code_type": "<code_type>",
      "code": "<code>"
    },
    "name": "list_hospital_code_costs"
  }
}

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.6/5.0
Behavior5/5

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

The annotations already declare a safe read (readOnlyHint/destructiveHint=false, openWorldHint=false), and the description adds substantial behavior beyond them: default returns every match (a few hundred), truncation is signalled by next_page_token and cross-checkable against total_count, figures come from a pooled serving snapshot so they can drift from earlier calls, and each figure merges facility and professional charges across all settings. It also flags that pre-change page_tokens are invalid, which prevents a real retry failure.

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?

Purpose and the primary use case are front-loaded, and nearly every sentence carries operational information (pagination loop, completeness check, alternative tool). The closing 'page_tokens from before this change are not valid' reads like changelog residue and slightly dilutes the otherwise tight structure.

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 an 8-parameter, paginated, output-schema-bearing aggregation tool, the description covers everything an agent needs: default page behavior, the truncation/continuation protocol, a completeness verification method, the meaning of the merged cost figure, and the correct sibling for a different breakdown. Output shape details are left to the output schema, which is appropriate.

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 88%, so the schema already carries most parameter meaning; the description mainly reinforces page_token reuse and clarifies that total_count/next_page_token describe the filtered match set. It adds nothing about methodology or min_sample_count that the schema does not already say, so the baseline 3 applies.

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?

States a specific verb and resource with scope: 'Returns cost stats for every hospital with a matching chargemaster entry for a code_type/code.' It immediately distinguishes itself from the single-hospital sibling get_hospital_chargemaster_cost and from list_code_provider_hospitals, so an agent can route without opening any schema.

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?

Gives an explicit when-to-use rule ('Use this instead of calling get_hospital_chargemaster_cost once per hospital when comparing prices...') with a concrete example question, and names a substitute for a different need ('use list_code_provider_hospitals for a per-billing-class breakdown instead'). It also prescribes the pagination loop and warns against the specific failure of concluding 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.