Skip to main content
Glama

Category trend

category_trends
Read-only

Spend for one category over time

The category key is exact. Food delivery is delivery. Fast casual is not a category. If an error names a category, retry that name.

One category's spend over the window, as a series by day, week or month (granularity). Use it for one category over time. To compare categories with each other, or to split one by state, metro or income, use the breakdown with group_by=category instead.

Purchases only. A breakdown counts every transaction type, so its total for the same category and window will not match this one unless that call passes transaction_type=purchase.

growth=true adds the previous window of the same length. weighting=population reweights to the mix of US adults (shares and growth, not market size). normalize adds share of spend or spend per account, and in population mode per household or share of income. deflate adds real dollars from CPI.

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": {
      "category": "<category>",
      "start_date": "<start_date>",
      "end_date": "<end_date>"
    },
    "name": "category_trends"
  }
}

Input Schema

NameRequiredDescriptionDefault
growthNoAdds a `growth` block comparing the immediately-preceding window of equal length.
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
categoryYesThe category to trend. 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`).
end_dateYesInclusive ISO-8601 date. At most 366 days after `start_date`.
normalizeNoAdds a normalized figure beside the raw ones: `share_of_spend` is the row's share of all spend under the same filters, `per_account` spend per active card. `per_household` and `share_of_income` need `weighting=population` (400 `normalize-requires-population`). `per_account` with `growth=true` is the figure for a brand's growth: every card counts, so it is not moved by which cards the population weights can place.none
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
start_dateYesInclusive ISO-8601 date.
granularityNoday, week, or month. Omit for one total over the window. total is not a value. When set, adds a bucketed series array.
income_bracketNoRestrict to one cardholder income band. `unknown` selects rows with no income upstream, which is where most spend sits — the dimension is populated for roughly 6% of volume, so an income cut is a slice of that, not of the model.
exclude_subscriptionsNoExclude membership/subscription fee rows (DashPass, Uber One, Instacart+, …). Defaults false.

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

A4.8/5.0
Behavior5/5

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

Annotations only declare it a safe read, but the description adds substantive behavior: it counts purchases only while a breakdown counts every transaction type (so totals will not match unless `transaction_type=purchase` is passed), and it discloses feature-level constraints such as `same_account` returning 403 `same-account-weighting-forbidden` in validation and needing whole settled months. It also flags that `normalize` population modes and `growth` change the response shape.

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 the sibling alternative are front-loaded, and later paragraphs are grouped by concern (counting basis, then optional blocks, then presentation). It is somewhat long, and the category-key examples ("Food delivery is delivery. Fast casual is not a category") partly restate the exhaustive key list already in the schema, but the redundancy is a light cost.

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 10-parameter, no-output-schema tool, the description covers what an agent needs: what the series looks like (bucketed by day/week/month), what each optional block adds to the response, and the counting-basis trap that would otherwise produce a silently wrong comparison against a sibling tool.

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 100%, so the schema already carries per-parameter meaning and the baseline is 3. The description earns above baseline by surfacing cross-parameter and cross-tool interactions the schema alone doesn't connect: the purchases-only mismatch with breakdown totals, and the reweighting/real-dollar effects of `weighting`, `normalize` and `deflate` on what the series actually means.

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?

Opens with a specific verb+resource+scope: "Spend for one category over time," and immediately distinguishes itself from the sibling `breakdown` by naming the exact alternative and its `group_by=category` mode. An agent can route between the two without reading 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 Guidelines5/5

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

Explicit when-to-use ("one category over time") and when-not-to-use ("To compare categories with each other, or to split one by state, metro or income, use the breakdown with `group_by=category`"), plus the recovery rule for unknown category names (retry the name in the error). That covers selection, exclusion, and failure handling.

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.