Aggregate Sheet Data
sheet.aggregateCompute one or more aggregations (COUNT, DISTINCT_COUNT, SUM, AVG, MIN, MAX, FIRST, LAST) over a sheet's rows, with optional filter and groupBy. Use for analytical questions like 'total revenue by stage', 'count of leads created this month', 'average response time per assignee'. Multiple functions in one call share the same column/filter/groupBy — pass ["SUM", "AVG"] together to get both for free. For date columns, group with timeBucket: 'month' (or 'quarter', etc.). Filter operators include the usual comparison ops plus date shortcuts (THIS_MONTH, BEFORE_TODAY, etc.) — see the schema. Filter values on Status, Select, Multi-Select, Pipeline, person, team, job and relation columns may be the names you see in sheet.read (e.g. 'Done'); grouped rows carry label = the name and labelId = the raw id. Read sheet.read once first to discover attribute codes; aggregate is the right tool when raw rows would exceed your context.
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": {
"sheetId": "<sheetId>",
"functions": "<functions>"
},
"name": "sheet.aggregate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| column | No | ||
| filter | No | ||
| groupBy | No | ||
| sheetId | Yes | ||
| functions | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | Aggregation rows as the worksheet service returns them, one per group | |
| summary | Yes | Echo of the request that ran |