aggregate
Groups rows in an Excel sheet and computes sum, count, mean, min, or max per group, with row and group filters.
Instructions
Fetches a sheet LIVE and runs a grouped aggregation. Operations: sum, count, mean, min, max. group_by is one column name or a list of them. conditions filters rows before aggregating (same grammar as filter_sheet, including the object form). having filters the AGGREGATED rows afterwards, e.g. having={"Revenue": ">1000"} keeps only groups whose aggregate exceeds 1000. SINGLE FILE ONLY. For totals across multiple files you MUST use cross_file_aggregate instead — never use this tool and then manually add results across files. Get column names from get_workspace_graph first. Returns rows plus a truncated flag. If conditions matched zero rows, zero_match_diagnostics shows what each condition matched alone and the values actually present — correct the condition and retry.
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": {
"file_name": "<file_name>",
"sheet": "<sheet>",
"group_by": "<group_by>",
"value_col": "<value_col>",
"operation": "<operation>"
},
"name": "aggregate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sheet | Yes | ||
| having | No | ||
| group_by | Yes | ||
| file_name | Yes | ||
| operation | Yes | ||
| value_col | Yes | ||
| conditions | No | ||
| folder_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||