Aggregate
aggregateBuild time-windowed aggregation queries by specifying a table, metric column, aggregation function, and optional time column with interval for grouping. No raw SQL needed.
Instructions
Build and run a time-windowed aggregation query without writing raw SQL. Specify a table, metric column, aggregation function, and optional time column with interval for grouping.
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": {
"table": "<table>",
"metric": "<metric>",
"func": "<func>"
},
"name": "aggregate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name to aggregate from. | |
| metric | Yes | Column to aggregate (e.g. 'revenue', 'count'). | |
| func | Yes | Aggregation function. | |
| timeColumn | No | Date/DateTime column to group by time window. Omit for a single aggregate. | |
| interval | No | Time bucketing interval. Required if timeColumn is set. | |
| filter | No | Optional WHERE clause condition (without the WHERE keyword). | |
| groupBy | No | Optional additional column to group by. |