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
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), 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).
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +]
  2. 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"
      +}
  3. Added

TDQS

A4.3/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, so safety is covered; the description goes well beyond that by disclosing two concrete failure modes (INVALID_ARGUMENT for an over-specified filter, UNAVAILABLE before a snapshot is opened) and the invariant that billing classes are never blended. Since there is no output schema, the first sentence also carries the burden of describing what comes back, which it does item by item.

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?

Two dense sentences, front-loaded with the returned distribution shape and followed by the constraint and failure-mode summary; nothing is decorative. The nested parenthetical lists make it heavier than ideal to scan, but every clause carries operational information.

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 an 8-parameter read tool with a nested filter and no output schema, the description covers the result contents, the largest correctness trap (group_by/filter term mismatch), and availability failure. Remaining gaps are minor because the schema already documents bin_count defaults, statistic default and min_sample_count validation.

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 88% and the filter and group_by schema descriptions already spell out the 'left out matches any value' rule, the *_UNSPECIFIED meaning, and the applied-before-filter ordering, so the description largely restates structured data rather than adding new meaning. Baseline 3 applies; statistic, reference_price/hospitals_below_reference, min_sample_count and bin_count receive no extra interpretation here.

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?

Specific verb and resource: it computes a per-hospital price distribution for a code, and the first sentence even enumerates the returned statistics (min/p10/q1/median/q3/p90/max, std dev, histogram, nearest hospital per percentile). It additionally distinguishes itself from the sibling get_code_price_distribution by naming it as its counterpart, so an agent can tell the two apart 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?

The counterpart reference to get_code_price_distribution gives clear usage context, and the description states a hard prerequisite ('fails with UNAVAILABLE until the server has opened [a snapshot]') plus the filter/group_by combination rules that cause INVALID_ARGUMENT. What it never says explicitly is when to prefer this over the provider-oriented siblings such as get_code_provider_terms_summary or list_code_provider_hospitals, so the routing guidance is present but not exhaustive.

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.