aggregate
Perform server-side aggregation on Mexico City open data using GROUP BY queries and custom metrics to analyze datasets like crime statistics, 911 calls, and air quality.
Instructions
Server-side aggregation (GROUP BY + metric) via CKAN datastore SQL.
Example: aggregate("fgj", group_by="alcaldia_hecho", metric='count(*) as delitos', where="anio_hecho=2025").
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": {
"dataset_id": "<dataset_id>",
"group_by": "<group_by>"
},
"name": "aggregate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | ||
| group_by | Yes | ||
| metric | No | count(*) as total | |
| where | No | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |