Skip to main content
Glama

Preview the rows of a dataset file

preview_dataset
Read-only

Read the first rows of a dataset's CSV/TSV file directly from the publisher and return the column names, inferred column types, the delimiter and encoding, and up to 20 sample rows as published. Works for datasets whose get_dataset record shows preview_available: true. Normally reads the first 64 KiB (up to 256 KiB only when the first CSV record is very wide), so it shows structure and example values, not totals over the whole file; for those, its analysis block gives the download links, a DuckDB query in the file's own dialect and the domains to allow in a sandbox. Example: {"id":"national:d04b704a-1672-4567-bf0d-9a9452618812","rows":5}.

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": {
      "id": "<id>"
    },
    "name": "preview_dataset"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesDataset id as returned by search_datasets or get_dataset.
rowsNoNumber of sample rows, default 10.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true, so the safety profile is covered; the description earns credit for adding the real behavioral detail on top: a hard read budget of 64 KiB normally and 256 KiB only when the first CSV record is very wide, plus the fact that reads go 'directly from the publisher'. What it leaves implicit is failure behavior when the file is unreachable or preview_available is false, and there is no output schema to describe the response shape.

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?

The opening sentence is front-loaded with the verb, resource, and return payload, and the clauses that follow each carry a distinct fact - eligibility, byte budget, what it is not for, and where to go instead. It runs long for a two-parameter tool and the analysis-block sentence packs several ideas together, but no sentence is filler.

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

Completeness5/5

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

There is no output schema, yet the description fully specifies the return payload (column names, inferred types, delimiter, encoding, sample rows) and the truncation limit that will apply. Given a two-parameter tool with complete schema coverage and full annotations, nothing an agent needs in order to call it correctly or interpret the result is missing.

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 100%, so the schema itself documents both parameters and the baseline is 3. The description adds genuine meaning beyond it by supplying a worked example with a namespaced id ('national:d04b704a-...') and rows=5, which clarifies the id format the schema only gestures at with 'as returned by search_datasets or get_dataset'.

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 names a specific verb and resource ('Read the first rows of a dataset's CSV/TSV file directly from the publisher') and enumerates exactly what comes back: column names, inferred types, delimiter, encoding, and up to 20 sample rows. It also distinguishes itself from the metadata sibling by tying eligibility to 'get_dataset record shows preview_available: true', so an agent can route between get_dataset and preview_dataset without opening either schema.

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

Usage Guidelines5/5

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

It gives an explicit precondition (the dataset must show preview_available: true) and an explicit when-not: this shows structure and example values 'not totals over the whole file', with the alternative named - the analysis block containing download links, a DuckDB query in the file's own dialect, and sandbox allowlist domains. That is when-to-use, when-not-to-use, and the alternative all in one place.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.