Skip to main content
Glama

Compare to a benchmark

compare_to_benchmark
Read-only

A model series beside a public benchmark series

Monthly model purchase spend (metric=spend, the default), transactions or accounts — for everything, a category / subcategory, or a set of merchant_ids, among cardholders in geo — beside one public series (series_id, from the benchmark catalog).

Both sides are aligned at the coarser frequency: against a quarterly or annual series the model is summed over each complete quarter or year (accounts are averaged); an incomplete one is dropped. Each row carries both values, both indexed to 100 at the first period where both exist, and both year over year (percentage points for a series that is itself a percent). The summary gives n_periods, the Pearson correlation of period-over-period changes (null under 6 changes), mean_abs_gap between the two indexes (index points) and mean_abs_yoy_gap (percentage points).

The series is read at series_geo, by default geo when the series is published there, else the geo's state, else the nation (series_geo_fallback: true). deflate puts model spend in real dollars of the newest CPI month. The model side is clamped by the key's freshness tier; the public side never is.

Restaurants against a food services series (NAICS 722) carry comparability_note: the model's restaurants are limited-service chains, and 722 is every restaurant and bar. Say so beside the comparison, every time.

Talk to the user in plain words: no tool, parameter or field names. Say "the American Spend model", never "panel" or a data source.

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": {
      "series_id": "<series_id>"
    },
    "name": "compare_to_benchmark"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoLast month, `YYYY-MM`. Default the last full month. At most 60 months in all.
geoNoCardholder geography: `us` (default), `state:TX`, or `cbsa:19100` — a CBSA code, `NM-<state>` bucket or metro name (resolved as the breakdown's `location` is).us
groupNoRestrict the model side to a merchant group's members, by slug or UUID (`find_groups` lists them). Wins over `merchant_id` and `category`; echoed under `merchant_group`.
startNoFirst month, `YYYY-MM`. Default eleven months before `end`.
metricNoModel measure. `accounts` is a monthly distinct-account count (averaged over a quarter or year).spend
deflateNoAdds real (inflation-adjusted) spend in base-month dollars, from CPI-U — the US city average (`cpi_u`) or the row's most specific published area (`cpi_regional`). The CPI item is the one the row's category maps to, all items otherwise.none
categoryNoRestrict the model side to one category. Category keys are lower-case and exact: `automotive`, `delivery`, `education`, `entertainment`, `financial_services`, `gifts_donations`, `government`, `grocery`, `healthcare`, `home_services`, `personal_care`, `pets`, `professional_services`, `restaurants`, `retail`, `subscriptions`, `tax_services`, `technology`, `travel`, `utilities`, `uncategorized`, plus older keys the data still carries (list every key with the breakdown, `group_by=category`). Any other name is a 400 `…/problems/category-unknown` whose `candidates` are the closest keys (`Groceries` → `grocery`).
series_idYesOne id from the benchmark catalog.
weightingNo`raw` (the default): model volume, `weighted_cents` equals `total_cents`. `population`: the weighted fields reweight the model to the mix of US adults (for shares, comparisons and growth, not market size), with `effective_n`, `low_precision`, `suppressed` and a `weighting` object. A month has weights once it has been raked, from 2025-09 on. `same_account`: growth compares one set of accounts, those with spend in the model in both of two months, chained month by month, so accounts arriving or leaving can't move it. It is turnover-adjusted: each month also carries the merchant's or category's own balance of accounts arriving and leaving (the median over 12 months), which shared accounts alone miss. Levels and shares stay raw. A growth block gains `same_account_change_pct` and `same_account_yoy_pct`, or `same_account_unavailable` saying why not, and a monthly series carries chained dollars in `weighted_cents`. It needs whole, settled calendar months, the newest month waits for the month after it on the default `stable` accounts, and it is in validation (403 `same-account-weighting-forbidden` until open to the key). Omit it to get the response shape callers had before it existed.raw
series_geoNoThe public series' geography, in the same form as `geo`. Defaults to `geo` when the series is published there, else its state, else the nation.
merchant_idNoRestrict the model side to these merchant UUIDs (comma-separated, max 50). Wins over `category`.
subcategoryNoRestrict to one subcategory of `category`. Subcategory keys are lower-case and exact (`supermarket`, `fast_food`; list them with the breakdown, `group_by=subcategory`). Any other name is a 400 `…/problems/subcategory-unknown` whose `candidates` are the closest keys. Three `retail` keys: `wholesale_clubs` is warehouse clubs & supercenters (Costco, Sam's Club, BJ's, Walmart); `department_stores` is Macy's, Kohl's, Nordstrom and Target; `marketplaces` is eBay, Temu and TikTok Shop.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / weighting / description
      Previous value: -"`raw` (the default): model volume, `weighted_cents` equals\n`total_cents`. `population`: the weighted fields reweight the model\nto the mix of US adults (for shares, comparisons and growth, not\nmarket size), with `effective_n`, `low_precision`, `suppressed` and\na `weighting` object. A month has weights once it has been raked,\nfrom 2025-09 on. `same_account`: growth compares one set of accounts,\nthose with spend in the model in both of two months, chained month by\nmonth, so accounts arriving or leaving can't move it. Levels and\nshares stay raw. A growth block gains `same_account_change_pct` and\n`same_account_yoy_pct`, or `same_account_unavailable` saying why not,\nand a monthly series carries chained dollars in `weighted_cents`. It\nneeds whole, settled calendar months, the newest month waits for the\nmonth after it on the default `stable` accounts, and it is in validation (403\n`same-account-weighting-forbidden` until open to the key). Omit it to\nget the response shape callers had before it existed."New value: +"`raw` (the default): model volume, `weighted_cents` equals\n`total_cents`. `population`: the weighted fields reweight the model\nto the mix of US adults (for shares, comparisons and growth, not\nmarket size), with `effective_n`, `low_precision`, `suppressed` and\na `weighting` object. A month has weights once it has been raked,\nfrom 2025-09 on. `same_account`: growth compares one set of accounts,\nthose with spend in the model in both of two months, chained month by\nmonth, so accounts arriving or leaving can't move it. It is\nturnover-adjusted: each month also carries the merchant's or\ncategory's own balance of accounts arriving and leaving (the median\nover 12 months), which shared accounts alone miss. Levels and shares stay raw. A growth block gains `same_account_change_pct` and\n`same_account_yoy_pct`, or `same_account_unavailable` saying why not,\nand a monthly series carries chained dollars in `weighted_cents`. It\nneeds whole, settled calendar months, the newest month waits for the\nmonth after it on the default `stable` accounts, and it is in validation (403\n`same-account-weighting-forbidden` until open to the key). Omit it to\nget the response shape callers had before it existed."
  2. First observed

TDQS

A3.8/5.0
Behavior5/5

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

Well beyond the readOnly/non-destructive annotations, it discloses alignment at the coarser frequency, that incomplete quarters/years are dropped, index-to-100 and YoY treatment, the summary fields and their units, the series_geo fallback cascade, deflate semantics, and that the model side is clamped by freshness tier while the public side is not. It also mandates a `comparability_note` for restaurants vs NAICS 722, which is exactly the kind of caveat an agent could not infer. This is rich, non-obvious behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core description is front-loaded and logically ordered (what it compares, how alignment works, what the response holds, caveats), but the prose is dense and runs long with backtick-heavy field talk. The closing line about talking to the user in plain words is a style instruction rather than tool semantics and sits awkwardly in a tool definition.

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 12-parameter, no-output-schema comparison tool, the description covers output shape (indexes, YoY, summary statistics and units), alignment behavior, and geo fallback well. It leaves error behavior and the significance of a null correlation only partly addressed, but nothing an agent needs to call it correctly is glaringly absent.

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 100%, so the schema already documents all 12 parameters and the description's param-adjacent prose largely echoes it. It does add some meaning, such as the default `metric=spend` framing and the freshness-tier clamping interaction, but the marginal value over the schema is modest. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line plus the body state the specific operation: model spend/transactions/accounts placed beside one public benchmark series and aligned at the coarser frequency. That is clear enough that an agent knows what it produces. It does not name the alternatives (list_benchmarks for the catalog, benchmark_series, panel) that would disambiguate it against siblings.

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

Usage Guidelines3/5

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

Usage is implied by the parameter framing ('series_id from the benchmark catalog', 'one public series') rather than stated. There is no explicit when-to-use vs. benchmark_series or panel, no prerequisites, and no exclusions. The only routing-adjacent content is which series/category combinations make sense.

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.