Skip to main content
Glama

Query a dataset with SQL

query_dataset
Read-onlyIdempotent

Run one read-only SQL statement over a dataset version on the server (requires auth): DuckDB reads the version's Parquet parts as the table records (extra fields of an allowExtra schema are the JSON column _extra). Use it for counts, averages and filters instead of paging through read_dataset. Limits: versions up to 2 GiB of parts, 20 seconds, 1000 rows returned (truncated says if more matched). The result size counts toward your egress; a paid dataset answers with its price.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesone SQL statement over the table `records` — e.g. SELECT target, avg(latency_ms) FROM records GROUP BY 1; DESCRIBE records shows the columns
slugYes
limitNorows to return (default 200)
versionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantial context beyond them: auth requirement, DuckDB Parquet mapped to the `records` table, `_extra` JSON column, 2 GiB / 20 second / 1000 row limits, the `truncated` signal, and that result size counts toward egress and paid datasets respond with a price.

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-loads the core action and then packs auth, semantics, limits, and cost into a tight sequence with zero filler. Dense but every clause carries operational information, so it is efficient though slightly heavy for one paragraph.

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?

With no output schema, the description carries return behavior well (`truncated`, row cap, egress cost). It is nearly complete for a query tool, with the only gap being that `slug` and `version` semantics are left to the schema.

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

Parameters3/5

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

Schema coverage is 50% (sql and limit documented). The description reinforces the SQL target table and `_extra` column, adding some meaning, but says nothing about `slug` or `version`, leaving two parameters undocumented in both places. Baseline 3 is appropriate.

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?

States a precise verb+resource: 'Run one read-only SQL statement over a dataset version on the server'. It also names the sibling it replaces ('instead of paging through read_dataset'), so an agent can distinguish it from read_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?

Gives explicit when-to-use ('counts, averages and filters') and the alternative ('instead of paging through read_dataset'). The condition selecting this tool over the read/paging sibling is spelled out rather than left to inference.

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.