TablesRead-only

Aggregate table rows

aggregate_table_rows

Compute sum / count / avg / min / max over a table field, optionally grouped by up to three fields and filtered — the fast way to answer "what did I spend on groceries last month" without paging through rows. Formula, rollup, lookup and count fields are materialised, so they aggregate exactly like a stored number. Money fields are grouped by currency unless you explicitly ask for a mixed-currency total.

Parameters

ParameterTypeRequiredDescription
tableIdstringrequiredTable ID — get from list_tables
op"sum" | "count" | "avg" | "min" | "max"requiredAggregation to compute
fieldKeystringoptionalField key to aggregate. Required for everything except count.
groupBystring[]optionalField keys to group by, e.g. ["category"] or ["accountName", "currency"]
filtersobject[]optionalField filters, ANDed together
limitintegeroptionalMaximum groups returned (max 5000)
mixedCurrenciesbooleanoptionalSet true to sum or average a money field ACROSS currencies. Without it, a money field is grouped by the table’s currency field so amounts in different currencies are never added together.

Example call

The tool call an MCP client sends (required arguments shown with placeholder values).

{
"tool": "aggregate_table_rows",
"arguments": {
"tableId": "tableId_123",
"op": "value"
}
}

Use this tool in

Related Tables tools