Skip to main content
Glama

Mostly Right

Query what a run built

query_run
Read-onlyIdempotent

Runs one read-only SQL statement over the parquet a run sealed, and waits for the answer. THIS IS HOW YOU CHECK THE DATA IS RIGHT before promoting anything: count the rows, look at the range, find the nulls. Example: {"run_id": "…", "sql": "SELECT count(*) AS rows, min(observed_at) AS first, max(observed_at) AS last FROM t", "max_rows": 100}. One statement, beginning SELECT, WITH, EXPLAIN or DESCRIBE. Returns {query_id, state, rows, row_count, truncated, elapsed_ms, result_digest}. max_rows is capped at 100, and a wide answer is trimmed further to keep the result under 16 KiB (rows_omitted says so) — aggregate in the statement rather than paging, or download the parquet with get_artifact_download. If the wait runs out the answer is query_timed_out carrying query_id — call again with that query_id (and no sql) to read the same execution rather than paying for a second. wait_seconds is capped at 20.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlNo
run_idYes
max_rowsNo
query_idNo
wait_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations cover read-only/idempotent/non-destructive, and the description adds a great deal: allowed statement prefixes, max_rows cap, 16 KiB trimming, wait/timeout behavior, and query_id reuse. The only blemish is mentioning 'rows_omitted' while the listed return shape says 'truncated', which slightly muddies the behavioral contract.

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

Conciseness5/5

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

The description is long but each sentence is functional: purpose, use case, example, constraints, return shape, size limits, and retry behavior. There is no filler, and the most important scoping information is front-loaded.

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 correctly supplies the return fields and the key timeout/truncation behaviors. However, it does not explain all return field semantics such as possible state values or what result_digest represents. Still, it provides enough to invoke the tool and handle the main outcomes.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full parameter burden. It explains run_id, sql restrictions, max_rows cap, query_id reuse on timeout, and wait_seconds cap, plus gives a complete example call. This fully compensates for the empty schema descriptions.

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 states a specific verb and resource: 'Runs one read-only SQL statement over the parquet a run sealed' and immediately gives a concrete use case ('check the data is right before promoting anything'). It is clearly distinguishable from siblings like query_table and get_artifact_download.

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 explicitly says when to use this tool, including examples (count rows, look at the range, find nulls), and tells when not to use it by directing large/wide cases to aggregation or get_artifact_download. It also explains the timeout/resubmission workflow with query_id.

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.

Resources