Compare brands
compare_brandsCompare two brands over the same window
Each side is specified independently, in precedence order
group_* > ids_* > canonical_* > names_* > brand_*. A side
may be a merchant group (group_a=ai-providers; find_groups lists
them), against a brand or another group: its members are read as
one set, unique purchasers counted once across it, and the side
echoes merchant_group. Both sides share
one window and one set of filters. Exactly two sides. To rank a
longer peer set, use breakdown with group_by=merchant_id.
An ids_*, canonical_* or resolved brand_* side reads its
merchants' sub-brands, as the merchant query does;
include_children=false drops them from both sides. Merged rows
are always read. The side's merchant_ids echo the expanded set.
Exactly two sides. Name each with brand_a and brand_b; no search first. To rank more brands, call breakdown grouped by merchant_id.
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": {
"start_date": "<start_date>",
"end_date": "<end_date>"
},
"name": "compare_brands"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids_a | No | Canonical merchant UUID(s) for side A. | |
| ids_b | No | Canonical merchant UUID(s) for side B. | |
| brand_a | No | Brand token for side A, matched like the merchant query's `merchant`: the directory merchant it names (exact canonical/alias/DBA, then whole-word), read by id; descriptor substring only when no directory merchant matches it. The side echoes `matched_by` and, when resolved, `merchant_ids` and `matched_names` — the canonical names the figure is for, which the caller must show when they differ from the token. A token naming several merchants, or something more specific than any merchant in the directory (`Walmart+` over Walmart; `+` is the word "plus"), is 400 `…/problems/brand-a-ambiguous` with `candidates`. | |
| brand_b | No | Brand token for side B. Same form as `brand_a`; ambiguity is `brand-b-ambiguous`. | |
| group_a | No | Merchant group for side A, by slug or UUID. An unknown group is 400 `…/problems/group-a-unknown`. | |
| group_b | No | Merchant group for side B. Same form as `group_a`. | |
| names_a | No | Raw descriptor(s) for side A. Max 50. | |
| names_b | No | Raw descriptor(s) for side B. Max 50. | |
| end_date | Yes | Inclusive ISO-8601 date. At most 366 days after `start_date`. | |
| location | No | Coded metro. Matches merchant geography OR spender (cardholder) geography by default — narrow with `match_merchant` / `match_spender`. Spender scoping is what lets app-billed merchants (rideshare, whose merchant address is the processor HQ) be analysed by city. | |
| weighting | No | `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_date | Yes | Inclusive ISO-8601 date. | |
| canonical_a | No | Canonical name(s) for side A. | |
| canonical_b | No | Canonical name(s) for side B. | |
| match_spender | No | Include spender geography when filtering by `location`. Defaults true. | |
| income_bracket | No | Restrict 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. | |
| match_merchant | No | Include merchant geography when filtering by `location`. Defaults true. | |
| include_children | No | Expand a parent merchant to its sub-brands before matching. **Defaults true.** Merchants merged into the requested one are the same merchant and are always included, whatever this is set to — their history stays under the retired id. Applies to merchants named by id, canonical name, directory brand or group; exact descriptors are matched as given. Expansion fails open: a failed directory lookup expands nothing rather than failing the query. | |
| exclude_subscriptions | No | Exclude membership/subscription fee rows (DashPass, Uber One, Instacart+, …). Defaults false. |