Aggregate Dataset
aggregate_datasetComputes exact SUM, AVG, MIN, MAX, or COUNT values over filtered data.gov.in datasets with DuckDB, grouped by a chosen column, so agents avoid unreliable mental math.
Instructions
Compute an exact aggregation over a data.gov.in dataset using DuckDB.
Fetches filtered data, loads it into an in-memory DuckDB table, and
runs a deterministic SUM, AVG, MIN, MAX, or COUNT
grouped by the specified column. Use this instead of asking the LLM
to do mental math — results are guaranteed correct.
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": {
"resource_id": "<resource_id>",
"group_by": "<group_by>",
"metric_column": "<metric_column>"
},
"name": "aggregate_dataset"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filters | No | Column-value filters using **original** API column names. | |
| group_by | Yes | Column to group by (use ``snake_case`` names from ``inspect_schema``). | |
| operation | No | One of ``"sum"``, ``"avg"``, ``"min"``, ``"max"``, ``"count"`` (default ``"sum"``). | sum |
| resource_id | Yes | Dataset ``resource_id``. | |
| metric_column | Yes | Numeric column to aggregate (use ``snake_case`` name). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||