Skip to main content
Glama

Get one payer's price distribution for a code

get_code_payer_price_distribution
Read-only

Distribution (min/p10/q1/median/q3/p90/max, std dev, histogram, nearest hospital per percentile) of one payer's rate for a (code_type, code) across hospitals, one figure per hospital; the payer-specific counterpart to get_code_provider_price_distribution. The filter must name every term the group_by grouping keeps, else INVALID_ARGUMENT. Pass plan_slug (from list_payer_plans) to distribute one plan's rates alone; MEDIAN is then only valid with PAYER_GROUP_BY_PER_COMBINATION. 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>",
      "payer_slug": "<payer_slug>"
    },
    "name": "get_code_payer_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_byNoHow a hospital's rates are grouped (default PAYER_GROUP_BY_PER_COMBINATION: per billing class + methodology + setting). The filter must name every term the grouping keeps (PAYER_GROUP_BY_ALL with no filter, PAYER_GROUP_BY_BILLING_CLASS plus a billing_class, PAYER_GROUP_BY_METHODOLOGY plus a methodology, per-combination all three; PAYER_GROUP_BY_ALL_EXCEPT_PER_DIEM is one figure like ALL but without the per diem rows, so a day rate does not pull a stay's price down), else 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.
plan_slugNoOptional plan_slug from list_payer_plans: distribute that plan's rates alone (hospitals not filing the plan are left out). Empty means the payer as a whole.
statisticNoWhich figure to distribute (default average).
payer_slugYesA payer_slug from list_payers or list_code_payers, e.g. "aetna".
reference_priceNoWhen positive, the response counts how many are priced strictly below it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / group_by / description
      Previous value: -"How a hospital's rates are grouped (default PAYER_GROUP_BY_PER_COMBINATION: per billing class + methodology + setting). The filter must name every term the grouping keeps (PAYER_GROUP_BY_ALL with no filter, PAYER_GROUP_BY_BILLING_CLASS plus a billing_class, PAYER_GROUP_BY_METHODOLOGY plus a methodology, per-combination all three), else INVALID_ARGUMENT."New value: +"How a hospital's rates are grouped (default PAYER_GROUP_BY_PER_COMBINATION: per billing class + methodology + setting). The filter must name every term the grouping keeps (PAYER_GROUP_BY_ALL with no filter, PAYER_GROUP_BY_BILLING_CLASS plus a billing_class, PAYER_GROUP_BY_METHODOLOGY plus a methodology, per-combination all three; PAYER_GROUP_BY_ALL_EXCEPT_PER_DIEM is one figure like ALL but without the per diem rows, so a day rate does not pull a stay's price down), else INVALID_ARGUMENT."
    • changedInput schema / properties / group_by / enum
      Previous value: -[
      -  "PAYER_GROUP_BY_PER_COMBINATION",
      -  "PAYER_GROUP_BY_BILLING_CLASS",
      -  "PAYER_GROUP_BY_METHODOLOGY",
      -  "PAYER_GROUP_BY_ALL"
      -]New value: +[
      +  "PAYER_GROUP_BY_PER_COMBINATION",
      +  "PAYER_GROUP_BY_BILLING_CLASS",
      +  "PAYER_GROUP_BY_METHODOLOGY",
      +  "PAYER_GROUP_BY_ALL",
      +  "PAYER_GROUP_BY_ALL_EXCEPT_PER_DIEM"
      +]
    • changedInput schema / properties / statistic / enum
      Previous value: -[
      -  "PRICE_STATISTIC_UNSPECIFIED",
      -  "PRICE_STATISTIC_AVERAGE",
      -  "PRICE_STATISTIC_MEDIAN",
      -  "PRICE_STATISTIC_MIN",
      -  "PRICE_STATISTIC_MAX"
      -]New value: +[
      +  "PRICE_STATISTIC_UNSPECIFIED",
      +  "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. Changed2 schema fields changed
    • changedInput schema / properties / group_by / description
      Previous value: -"How a hospital's rates are grouped (default GROUP_BY_PER_COMBINATION: per billing class + methodology + setting). The filter must name every term the grouping keeps (GROUP_BY_ALL with no filter, GROUP_BY_BILLING_CLASS plus a billing_class, GROUP_BY_METHODOLOGY plus a methodology, per-combination all three), else INVALID_ARGUMENT. GROUP_BY_FACILITY_PLUS_PROFESSIONAL is not available for payer rates."New value: +"How a hospital's rates are grouped (default PAYER_GROUP_BY_PER_COMBINATION: per billing class + methodology + setting). The filter must name every term the grouping keeps (PAYER_GROUP_BY_ALL with no filter, PAYER_GROUP_BY_BILLING_CLASS plus a billing_class, PAYER_GROUP_BY_METHODOLOGY plus a methodology, per-combination all three), else 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: +[
      +  "PAYER_GROUP_BY_PER_COMBINATION",
      +  "PAYER_GROUP_BY_BILLING_CLASS",
      +  "PAYER_GROUP_BY_METHODOLOGY",
      +  "PAYER_GROUP_BY_ALL"
      +]
  3. Added

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/non-destructive annotations, the description discloses the exact returned figures (percentiles, std dev, histogram, nearest hospital per percentile), two distinct failure modes (INVALID_ARGUMENT on filter/group_by mismatch, UNAVAILABLE before the snapshot is opened), and the coupling between plan_slug and MEDIAN. That is substantive behavioral context an agent could not infer from annotations or schema.

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 output shape are front-loaded in the first sentence, followed by constraint and failure information in descending order of importance. The sentences are long and dense but nearly every clause carries operational weight; only the parenthetical output enumeration could be tightened.

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?

With no output schema and 10 parameters, the description carries the return-value burden and does so by enumerating the distribution outputs. Combined with error modes, the snapshot precondition, and grouping rules, an agent has enough to call this correctly without further reference.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 90%, so the baseline is 3; the description still adds meaning the schema does not, namely the rule that the filter must name every term the group_by grouping keeps or the call fails, and the plan_slug + MEDIAN interaction. It adds little on statistic, bin_count, reference_price, or state beyond what their schema descriptions already say.

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 names a concrete verb and resource — the min/p10/q1/median/q3/p90/max distribution of one payer's rate for a (code_type, code) across hospitals — and explicitly positions itself as "the payer-specific counterpart to get_code_provider_price_distribution." That naming lets an agent separate it from the provider-level sibling without opening either 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 real selection context: use plan_slug (from list_payer_plans) when only one plan's rates should be distributed, and MEDIAN is only valid with PAYER_GROUP_BY_PER_COMBINATION. It also states the UNAVAILABLE precondition on the serving snapshot. It does not contrast with other payer-aggregate siblings like get_code_payers_price_distribution or get_code_price_distribution, so a full 5 is not earned.

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.