query_records
Retrieve and filter Mexico City open data records from datasets like crime reports, 911 calls, air quality, and business registries using SQL-like queries.
Instructions
Query records from a CDMX dataset (CKAN datastore, PostgreSQL).
Args: dataset_id: id on datos.cdmx.gob.mx (or shortcut: fgj, 911, ids, aire). where: SQL-ish WHERE, e.g. anio_hecho=2025 AND alcaldia_hecho="BENITO JUAREZ". String literals can use single or double quotes; identifiers are quoted automatically. select: comma-separated columns (for fewer tokens). order_by: e.g. "fecha_hecho desc". limit: 1-100. Defaults to 50. offset: for pagination.
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>"
},
"name": "query_records"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | ||
| where | No | ||
| select | No | ||
| order_by | No | ||
| limit | No | ||
| offset | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |