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

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
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. Do not pass any other value (e.g. an offset or cursor you construct yourself) here.
methodologyNoPricing methodology. Omit to aggregate across all methodologies.

Output Schema

TableJSON 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
    • 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"
      +}
  2. 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"
      +}
  3. 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"
      +}
  4. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description adds valuable behavioral context beyond that: it returns every matching hospital by default, may truncate results, and requires following next_page_token until empty. It also explains total_count as a completeness check, which is exactly the kind of behavior an agent needs to know.

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?

The description is dense but every sentence earns its place: purpose, alternative use case, default behavior, pagination rule, and completeness check. It is front-loaded with the core purpose and then gives necessary operational details without fluff.

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 output schema exists and annotations cover safety, the description supplies the remaining critical context: when to choose this tool, how pagination works, and how to verify completeness via total_count. Nothing an agent needs to invoke the tool 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 80%, so the schema already documents most parameters. The description reinforces page_token usage and total_count semantics but does not add substantial new meaning for the parameters themselves beyond what the schema provides. This meets the baseline for high schema coverage without exceeding it.

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 opens with a specific verb and resource: 'Returns cost stats for every hospital with a matching chargemaster entry for a code_type/code.' It also names the sibling alternative (get_hospital_chargemaster_cost) and clarifies the cross-hospital comparison use case, so an agent can distinguish this tool from its siblings without inspecting schemas.

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?

The description explicitly says to use this tool instead of calling get_hospital_chargemaster_cost once per hospital when comparing prices across hospitals, providing a concrete example. It also gives detailed pagination instructions, including how to handle next_page_token and why not to stop after one page. This is clear, actionable guidance with an explicit alternative.

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.