Query the rows of an open-data dataset
query_datasetFetch and filter actual rows from opendata.swiss or City of Zürich datasets by dataset ID or direct CSV/JSON/GeoJSON URL, applying search, column filters, sort and paging.
Instructions
Fetch the actual data of an opendata.swiss / City of Zürich dataset and return matching rows. Picks the best machine-readable resource (CSV > JSON > GeoJSON; HTML landing pages, ZIP, XLSX, PDF and services are skipped and reported with their download URLs), parses it and applies search / column filters / sort / paging. Returns columns, total matched, rows, the resource used and its licence. Works with a dataset id or a direct resource_url. Run describe_dataset_columns first to learn column names and values. Examples: {id: '', where: {Kanton: 'ZH'}, sort: '-Einwohner', limit: 10}; {id: '', search: 'Winterthur', columns: ['Jahr','Wert']}; {resource_url: 'https://…/data.csv', where: {Jahr: '>2020'}}.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "query_dataset"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Dataset ID (slug): the 'id' of a search_datasets hit | |
| lang | No | Language for titles/descriptions: de, fr, it or en (default en; falls back to de) | |
| sort | No | Sort column; prefix '-' for descending, e.g. '-Jahr' | |
| limit | No | Rows to return (default 25, max 200; large rows are trimmed to fit 50 KB) | |
| where | No | Column filters: {column: value}. Exact (case-insensitive) match; prefix '~' for substring, '>'/'<' for numeric compare, e.g. {"Kanton": "ZH", "Jahr": ">2019"} | |
| format | No | Preferred resource format (overrides the CSV-first default) | |
| offset | No | ||
| portal | No | Catalogue: 'opendata.swiss' (default, national), 'stadt-zuerich' (City of Zürich, data.stadt-zuerich.ch) or 'envidat' (WSL/ETH environmental research data: snow, glaciers, forests, biodiversity, climate) | |
| search | No | Case-insensitive substring matched against every field | |
| columns | No | Only return these columns (names are matched case/accent-insensitively; max 50) | |
| resource | No | Optional resource selector: 0-based index from get_dataset, resource id, or part of its title. Default: best CSV > JSON > GeoJSON | |
| resource_url | No | Alternatively, a direct https URL of a CSV/JSON/GeoJSON file (e.g. a download_url from get_dataset). May be disabled on public deployments, prefer 'id' |