Skip to main content
Glama

Query the rows of an open-data dataset

query_dataset
Read-only

Fetch 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

NameRequiredDescriptionDefault
idNoDataset ID (slug): the 'id' of a search_datasets hit
langNoLanguage for titles/descriptions: de, fr, it or en (default en; falls back to de)
sortNoSort column; prefix '-' for descending, e.g. '-Jahr'
limitNoRows to return (default 25, max 200; large rows are trimmed to fit 50 KB)
whereNoColumn filters: {column: value}. Exact (case-insensitive) match; prefix '~' for substring, '>'/'<' for numeric compare, e.g. {"Kanton": "ZH", "Jahr": ">2019"}
formatNoPreferred resource format (overrides the CSV-first default)
offsetNo
portalNoCatalogue: '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)
searchNoCase-insensitive substring matched against every field
columnsNoOnly return these columns (names are matched case/accent-insensitively; max 50)
resourceNoOptional resource selector: 0-based index from get_dataset, resource id, or part of its title. Default: best CSV > JSON > GeoJSON
resource_urlNoAlternatively, 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'

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.3

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnlyHint/openWorldHint annotations, it discloses the resource selection policy (CSV > JSON > GeoJSON), that HTML/ZIP/XLSX/PDF and services are skipped and reported with URLs, and what the response contains (columns, total matched, rows, resource used, licence). No output schema exists, so this return-field summary is carrying real weight; it stops short of documenting paging limits or error behavior beyond the 50 KB trim noted in the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the action and return shape, then the resource-selection rules, then the prerequisite, then examples. Dense but every sentence carries information; the inline examples are justified given twelve parameters and no output schema, though the single long paragraph could be broken up for scanning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-required-parameter tool with twelve parameters, nested `where` objects, a URL alternative and no output schema, the description supplies the prerequisite, the resource fallback logic, the return fields and concrete call shapes. Only edge behavior (what happens on failed parse, empty matches, or disabled resource_url) is left to the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 92%, so the schema does the heavy lifting, but the description adds value by showing parameters in combination – `where` with `sort`/`limit`, `search` with `columns`, and an operator-bearing `where` on a direct `resource_url` – which clarifies intent better than the per-parameter text alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('Fetch the actual data of an opendata.swiss / City of Zürich dataset and return matching rows') and distinguishes itself from 'describe_dataset_columns', which it declares as the prerequisite discovery step rather than a substitute.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly states the prerequisite ('Run describe_dataset_columns first to learn column names and values'), supports two entry modes (dataset id or direct resource_url), and gives three worked examples covering filter/sort and search usage. What is missing is an explicit when-not clause pointing at the aggregation or data-cube siblings for summed/precomputed queries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools