Skip to main content
Glama

Compare payers' prices for a code

get_code_payers_price_distribution
Read-only

Distribution of a code's price across payers, one figure per payer (how the payers compare), the third view beside get_code_provider_price_distribution (over hospitals) and get_code_payer_price_distribution (over one payer's hospitals). The filter must name every term the group_by grouping keeps, else INVALID_ARGUMENT. Each payer is reduced to one figure over its hospitals (average weighted by rate lines; MEDIAN is the median of the hospitals' averages; MIN/MAX the lowest/highest hospital row). 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_payers_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.
statisticNoWhich figure to distribute (default average).
reference_priceNoWhen positive, the response counts how many are priced strictly below it.
min_hospital_countNoLeave out payers filed by fewer hospitals than this (0 or 1: none). Negative is rejected.
include_class_breakdownNoAlso return `facility` and `professional` (median price over payers and payer_count for each billing class, always both, for a facility-vs-professional comparison in one call). Only answered for a national request (no state, average statistic, min_hospital_count 0/1, a filter naming no methodology or setting); otherwise they are left unset.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 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"
      +]
    • addedInput schema / properties / include_class_breakdown
      Added value: +{
      +  "description": "Also return `facility` and `professional` (median price over payers and payer_count for each billing class, always both, for a facility-vs-professional comparison in one call). Only answered for a national request (no state, average statistic, min_hospital_count 0/1, a filter naming no methodology or setting); otherwise they are left unset.",
      +  "type": "boolean"
      +}
    • 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

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered. The description still adds genuine behavioral context: the per-payer aggregation rules (weighted average, median of hospital averages, min/max of hospital rows) and the fact that it fails with UNAVAILABLE until a serving snapshot is open, which is useful operational knowledge not implied by annotations.

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?

Opens with the purpose and the sibling comparison, then layers constraints and aggregation semantics, so it is front-loaded and free of filler. Some parenthetical clauses run long and pack several rules into single sentences, which slightly costs scannability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter tool with a nested filter, 2 enums, and no output schema, it covers the tricky parts: group_by/filter coupling, statistic aggregation, the national-only restriction on include_class_breakdown, and the snapshot prerequisite. It leaves the histogram/binning behavior (bin_count) and the reference_price count-outcome unstated, deferring to schema descriptions.

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 90%, so the schema already carries the parameter documentation burden. The description adds meaning where the schema cannot: the coupling between filter and group_by (must name every kept term) and the validity conditions for include_class_breakdown. Beyond those, it mostly restates what the enum-based schema parameters already explain.

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 (price distribution of a code across payers) and explicitly situates it as "the third view beside" two named siblings with their scopes spelled out (over hospitals, over one payer's hospitals). An agent can distinguish this from the sibling views 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 Guidelines4/5

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

Names the two alternatives and their differing scopes, plus the constraint that the filter must name every term the group_by keeps or the call fails with INVALID_ARGUMENT. It stops short of an explicit "use this when you want payer-to-payer comparison, not X" sentence, but the comparative framing gives clear selection context.

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.