Skip to main content
Glama

Get provider price distribution for a code

get_code_provider_price_distribution
Read-only

Distribution (min/p10/q1/median/q3/p90/max, std dev, histogram, nearest hospital per percentile) of one figure per hospital for a code, never blending billing classes. The filter must name every term the group_by grouping keeps (all three of billing_class, methodology and setting for the default; the billing class or the methodology for those groupings; nothing for GROUP_BY_ALL), else INVALID_ARGUMENT; use *_UNSPECIFIED for 'not filed'. Counterpart to get_code_price_distribution. Backed by the hospital-prices serving snapshot; fails with UNAVAILABLE until the server has opened one.

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": "get_code_provider_price_distribution"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
stateNoOptional two-letter USPS state code (e.g. "TX", case-insensitive): only hospitals with a location in that state are counted. A hospital in several states counts in each, so state figures can add up to more than national ones. Empty means every hospital; anything that is not a state code is rejected as INVALID_ARGUMENT.
filterNoKeeps only some of the grouped rows (see group_by). Each field left out matches any value; set a field (even to its *_UNSPECIFIED value, which means 'not filed') to require it. Billing classes are never blended: a facility fee and a professional fee are separate bills.
group_byNoWhich rows exist: one per billing class + methodology + setting (GROUP_BY_PER_COMBINATION, the default), per billing class, per methodology, or GROUP_BY_ALL (one figure over everything, blending billing classes), GROUP_BY_ALL_EXCEPT_PER_DIEM (like ALL but without per diem rows, since a per diem is a price for a day), GROUP_BY_BILLING_CLASS_METHODOLOGY (one row per billing class and methodology, pooled over settings; name both in the filter for one figure per hospital), or GROUP_BY_FACILITY_PLUS_PROFESSIONAL (one row per methodology and setting the hospital files under both the facility and the professional billing class, the two added together, i.e. the combined bill; terms are methodology and setting, no billing class; no row where there is no professional counterpart). Applied before filter, which may name only the terms the grouping still keeps (e.g. GROUP_BY_BILLING_CLASS with a methodology filter, or GROUP_BY_ALL with any filter, is rejected as INVALID_ARGUMENT).
bin_countNoHistogram bars. Defaults to 16, max 200.
code_typeYesCode system the billing code belongs to, e.g. APR-DRG, CDM, CPT, HCPCS, MS-DRG, RC.
statisticNoWhich per-hospital figure to distribute (default average). The PERCENT_OF_CHARGES_* values distribute the percentage of billed charges of rows filed under the percent-of-total-billed-charges methodology instead of dollars (every value in the response is then in whole percent; hospitals with no such row are left out); best with the methodology named in the filter.
reference_priceNoWhen positive, hospitals_below_reference counts hospitals priced strictly below it.
min_sample_countNoOnly hospitals backed by at least this many billing records. Negative values are rejected.
include_class_breakdownNoAlso return `facility` and `professional` (median and hospital count of each billing class's per-hospital figures, the same as one call per class, no histogram) so a facility-vs-professional comparison needs one call. Both classes are always returned whatever billing class the filter names; they follow state, the filter's methodology and whether group_by is GROUP_BY_ALL_EXCEPT_PER_DIEM.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / group_by / description
      Previous value: -"Which rows exist: one per billing class + methodology + setting (GROUP_BY_PER_COMBINATION, the default), per billing class, per methodology, or GROUP_BY_ALL (one figure over everything, blending billing classes), or GROUP_BY_FACILITY_PLUS_PROFESSIONAL (one row per methodology and setting the hospital files under both the facility and the professional billing class, the two added together, i.e. the combined bill; terms are methodology and setting, no billing class; no row where there is no professional counterpart). Applied before filter, which may name only the terms the grouping still keeps (e.g. GROUP_BY_BILLING_CLASS with a methodology filter, or GROUP_BY_ALL with any filter, is rejected as INVALID_ARGUMENT)."New value: +"Which rows exist: one per billing class + methodology + setting (GROUP_BY_PER_COMBINATION, the default), per billing class, per methodology, or GROUP_BY_ALL (one figure over everything, blending billing classes), GROUP_BY_ALL_EXCEPT_PER_DIEM (like ALL but without per diem rows, since a per diem is a price for a day), GROUP_BY_BILLING_CLASS_METHODOLOGY (one row per billing class and methodology, pooled over settings; name both in the filter for one figure per hospital), or GROUP_BY_FACILITY_PLUS_PROFESSIONAL (one row per methodology and setting the hospital files under both the facility and the professional billing class, the two added together, i.e. the combined bill; terms are methodology and setting, no billing class; no row where there is no professional counterpart). Applied before filter, which may name only the terms the grouping still keeps (e.g. GROUP_BY_BILLING_CLASS with a methodology filter, or GROUP_BY_ALL with any filter, is rejected as INVALID_ARGUMENT)."
    • changedInput schema / properties / group_by / enum
      Previous value: -[
      -  "GROUP_BY_PER_COMBINATION",
      -  "GROUP_BY_BILLING_CLASS",
      -  "GROUP_BY_METHODOLOGY",
      -  "GROUP_BY_ALL",
      -  "GROUP_BY_FACILITY_PLUS_PROFESSIONAL"
      -]New value: +[
      +  "GROUP_BY_PER_COMBINATION",
      +  "GROUP_BY_BILLING_CLASS",
      +  "GROUP_BY_METHODOLOGY",
      +  "GROUP_BY_ALL",
      +  "GROUP_BY_FACILITY_PLUS_PROFESSIONAL",
      +  "GROUP_BY_BILLING_CLASS_METHODOLOGY",
      +  "GROUP_BY_ALL_EXCEPT_PER_DIEM"
      +]
    • addedInput schema / properties / include_class_breakdown
      Added value: +{
      +  "description": "Also return `facility` and `professional` (median and hospital count of each billing class's per-hospital figures, the same as one call per class, no histogram) so a facility-vs-professional comparison needs one call. Both classes are always returned whatever billing class the filter names; they follow state, the filter's methodology and whether group_by is GROUP_BY_ALL_EXCEPT_PER_DIEM.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / statistic / description
      Previous value: -"Which per-hospital figure to distribute (default average)."New value: +"Which per-hospital figure to distribute (default average). The PERCENT_OF_CHARGES_* values distribute the percentage of billed charges of rows filed under the percent-of-total-billed-charges methodology instead of dollars (every value in the response is then in whole percent; hospitals with no such row are left out); best with the methodology named in the filter."
    • changedInput schema / properties / statistic / enum
      Previous value: -[
      -  "PRICE_STATISTIC_AVERAGE",
      -  "PRICE_STATISTIC_MEDIAN",
      -  "PRICE_STATISTIC_MIN",
      -  "PRICE_STATISTIC_MAX"
      -]New value: +[
      +  "PRICE_STATISTIC_AVERAGE",
      +  "PRICE_STATISTIC_MEDIAN",
      +  "PRICE_STATISTIC_MIN",
      +  "PRICE_STATISTIC_MAX",
      +  "PRICE_STATISTIC_PERCENT_OF_CHARGES_AVERAGE",
      +  "PRICE_STATISTIC_PERCENT_OF_CHARGES_MEDIAN"
      +]
  2. Changed1 schema field changed
    • addedInput schema / properties / state
      Added value: +{
      +  "description": "Optional two-letter USPS state code (e.g. \"TX\", case-insensitive): only hospitals with a location in that state are counted. A hospital in several states counts in each, so state figures can add up to more than national ones. Empty means every hospital; anything that is not a state code is rejected as INVALID_ARGUMENT.",
      +  "type": "string"
      +}
  3. Changed2 schema fields changed
    • changedInput schema / properties / group_by / description
      Previous value: -"Which rows exist: one per billing class + methodology + setting (GROUP_BY_PER_COMBINATION, the default), per billing class, per methodology, or GROUP_BY_ALL (one figure over everything, blending billing classes). Applied before filter, which may name only the terms the grouping still keeps (e.g. GROUP_BY_BILLING_CLASS with a methodology filter, or GROUP_BY_ALL with any filter, is rejected as INVALID_ARGUMENT)."New value: +"Which rows exist: one per billing class + methodology + setting (GROUP_BY_PER_COMBINATION, the default), per billing class, per methodology, or GROUP_BY_ALL (one figure over everything, blending billing classes), or GROUP_BY_FACILITY_PLUS_PROFESSIONAL (one row per methodology and setting the hospital files under both the facility and the professional billing class, the two added together, i.e. the combined bill; terms are methodology and setting, no billing class; no row where there is no professional counterpart). Applied before filter, which may name only the terms the grouping still keeps (e.g. GROUP_BY_BILLING_CLASS with a methodology filter, or GROUP_BY_ALL with any filter, is rejected as INVALID_ARGUMENT)."
    • changedInput schema / properties / group_by / enum
      Previous value: -[
      -  "GROUP_BY_PER_COMBINATION",
      -  "GROUP_BY_BILLING_CLASS",
      -  "GROUP_BY_METHODOLOGY",
      -  "GROUP_BY_ALL"
      -]New value: +[
      +  "GROUP_BY_PER_COMBINATION",
      +  "GROUP_BY_BILLING_CLASS",
      +  "GROUP_BY_METHODOLOGY",
      +  "GROUP_BY_ALL",
      +  "GROUP_BY_FACILITY_PLUS_PROFESSIONAL"
      +]
  4. Changed3 schema fields changed
    • removedInput schema / properties / all_terms
      Removed value: -{
      -  "description": "Each hospital's all-terms figure. Cannot be combined with filter.",
      -  "type": "boolean"
      -}
    • changedInput schema / properties / filter / description
      Previous value: -"Restricts which price terms are returned. Each field left out matches any value; set a field (even to its *_UNSPECIFIED value, which means 'not filed') to require it. Billing classes are never blended: a facility fee and a professional fee are separate bills."New value: +"Keeps only some of the grouped rows (see group_by). Each field left out matches any value; set a field (even to its *_UNSPECIFIED value, which means 'not filed') to require it. Billing classes are never blended: a facility fee and a professional fee are separate bills."
    • addedInput schema / properties / group_by
      Added value: +{
      +  "description": "Which rows exist: one per billing class + methodology + setting (GROUP_BY_PER_COMBINATION, the default), per billing class, per methodology, or GROUP_BY_ALL (one figure over everything, blending billing classes). Applied before filter, which may name only the terms the grouping still keeps (e.g. GROUP_BY_BILLING_CLASS with a methodology filter, or GROUP_BY_ALL with any filter, is rejected as INVALID_ARGUMENT).",
      +  "enum": [
      +    "GROUP_BY_PER_COMBINATION",
      +    "GROUP_BY_BILLING_CLASS",
      +    "GROUP_BY_METHODOLOGY",
      +    "GROUP_BY_ALL"
      +  ],
      +  "type": "string"
      +}
  5. Added

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the read-only annotations, the description discloses important behavior: invalid filter/group_by combinations return INVALID_ARGUMENT, the tool is backed by the hospital-prices serving snapshot, and it returns UNAVAILABLE until the server has opened one. That is exactly the kind of operational context annotations cannot carry.

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 the distribution scope and packs necessary validation and failure information efficiently. It is dense and partly duplicates the rich schema, but the length is justified by the tool's complexity and the lack of an output schema.

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 complex tool with 10 parameters, nested filter, and no output schema, the definition covers purpose, key constraint interactions, failure behavior, and the returned distribution components. The remaining parameter detail is handled by the highly descriptive input schema.

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 coverage is 90%, so the input schema already documents nearly all parameters, including the detailed filter and group_by semantics. The description reinforces the cross-parameter rule that filter terms must match the group_by grouping, but it does not add much parameter 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 operation and scope: a price distribution of one per-hospital figure for a billing code, with billing classes never blended. It explicitly names its counterpart, get_code_price_distribution, so an agent can distinguish it from that sibling without opening another schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives substantial usage context through the group_by/filter invariant, *_UNSPECIFIED semantics, and the counterpart relationship. However, it does not explicitly say when to choose this tool over get_code_price_distribution or describe exclusion conditions beyond the validation rule.

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.