Skip to main content
Glama

Run SQL over the dataset

query_dataset
Read-onlyIdempotent

Run read-only DuckDB SELECTs over the dataset behind the other tools, for a question none of them asks. Call describe_dataset first; it lists the 31 views, their columns, joins and recipes. Prefer a typed tool when one fits.

  • statements=[…]: up to 5 statements in one call, one result or error each.

  • Result: columns, and rows as arrays, up to max_rows (≤ 500, default 100) and 16 KB. When truncated is true: aggregate, filter, or use LIMIT and OFFSET. One SELECT (or SHOW, DESCRIBE, FROM-first), no semicolon, 15 s limit, nothing outside the bundle.

  • Dev-branch isolation: JOIN contrib_branch and filter kind = 'dev_branch' AND project <> 'drupal' before counting projects. change_record_adoption, symbol_usage and core_symbol_evidence hold release tags too. core_symbol_evidence is the full rollup; symbol_usage is its string-scan subset.

  • Adoption polarity: legacy is still on the old API (not adopted); migrated is adopted. Versions are text: compare _seq integers (major1000+minor). Never SUM(usage) across branch rows.

  • Errors list the views, the columns of the views you used, or the join map. An empty result over an fqn without a leading backslash gets a hint.

  • The same views are downloadable as parquet under https://api.tresbien.tech/data/docs. Its cookbook targets api.duckdb plus prelude views this mirror does not have, so take recipes from describe_dataset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlNoOne DuckDB SELECT over the views describe_dataset lists. SHOW TABLES, DESCRIBE <view> and FROM-first syntax also work. No semicolon, one statement. Use statements for several at once.
max_rowsNoRows to return per statement, 1 to 500 (default 100). The result byte budget may cut a wide result sooner. truncated says so either way.
statementsNoUp to 5 statements in one call. Results come back in order under results, each with its own rows or error. The byte budget is shared. Use this instead of sql for more than one statement.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / max_rows / description
      Previous value: -"Rows to return per statement, 1 to 500 (default 100). The result byte budget may cut a wide result sooner; truncated says so either way."New value: +"Rows to return per statement, 1 to 500 (default 100). The result byte budget may cut a wide result sooner. truncated says so either way."
    • changedInput schema / properties / sql / description
      Previous value: -"One DuckDB SELECT over the views listed in the description. SHOW TABLES, DESCRIBE <view> and FROM-first syntax also work. No semicolon; one statement. Use statements for several at once."New value: +"One DuckDB SELECT over the views describe_dataset lists. SHOW TABLES, DESCRIBE <view> and FROM-first syntax also work. No semicolon, one statement. Use statements for several at once."
    • changedInput schema / properties / statements / description
      Previous value: -"Up to 5 statements run in one call (explore in one round trip): results come back in order under results, each with its own rows or error; the byte budget is shared. Use instead of sql when you have more than one."New value: +"Up to 5 statements in one call. Results come back in order under results, each with its own rows or error. The byte budget is shared. Use this instead of sql for more than one statement."
  2. Changed5 schema fields changed
    • changedInput schema / properties / max_rows / description
      Previous value: -"Rows to return, 1 to 500 (default 100). The result byte budget may cut a wide result sooner; truncated says so either way."New value: +"Rows to return per statement, 1 to 500 (default 100). The result byte budget may cut a wide result sooner; truncated says so either way."
    • changedInput schema / properties / sql / description
      Previous value: -"One DuckDB SELECT over the views listed in the description. SHOW TABLES, DESCRIBE <view> and FROM-first syntax also work. No semicolon; one statement."New value: +"One DuckDB SELECT over the views listed in the description. SHOW TABLES, DESCRIBE <view> and FROM-first syntax also work. No semicolon; one statement. Use statements for several at once."
    • addedInput schema / properties / statements
      Added value: +{
      +  "description": "Up to 5 statements run in one call (explore in one round trip): results come back in order under results, each with its own rows or error; the byte budget is shared. Use instead of sql when you have more than one.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
    • removedInput schema / required
      Removed value: -[
      -  "sql"
      -]
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": false,
      -  "properties": {
      -    "columns": {
      -      "items": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "name": {
      -            "type": "string"
      -          },
      -          "type": {
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "name",
      -          "type"
      -        ],
      -        "type": "object"
      -      },
      -      "type": [
      -        "null",
      -        "array"
      -      ]
      -    },
      -    "hint": {
      -      "type": "string"
      -    },
      -    "row_count": {
      -      "type": "integer"
      -    },
      -    "rows": {
      -      "items": {
      -        "items": true,
      -        "type": [
      -          "null",
      -          "array"
      -        ]
      -      },
      -      "type": [
      -        "null",
      -        "array"
      -      ]
      -    },
      -    "truncated": {
      -      "type": "boolean"
      -    }
      -  },
      -  "required": [
      -    "columns",
      -    "rows",
      -    "row_count",
      -    "truncated"
      -  ],
      -  "type": "object"
      -}New value: +null
  3. Changed1 schema field changed
    • addedOutput schema / properties / hint
      Added value: +{
      +  "type": "string"
      +}
  4. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already mark the tool read-only, idempotent, and non-destructive. The description adds substantial behavior beyond that: one-statement constraint, no semicolon, 15-second limit, 16 KB shared byte budget, truncation handling, dev-branch isolation rules, adoption polarity, and error behavior. No contradiction with annotations.

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 every block earns its place: purpose is front-loaded, followed by invocation rules, result semantics, data-model pitfalls, and error behavior. The bulleted structure makes dense operational guidance easy to scan.

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?

For a flexible SQL tool with no output schema, the description covers return shape, truncation, limits, error hints, required preliminary steps, domain-specific correctness rules, and external documentation caveats. An agent has enough context to invoke it correctly and interpret results.

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 baseline is 3. The description adds meaning by explaining statement limits, result truncation, byte budget, SQL syntax constraints, and when to use statements instead of sql. This goes beyond the schema's field-level 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?

States a specific verb and resource: run read-only DuckDB SELECTs over the dataset behind the other tools. It also distinguishes itself from siblings by targeting questions none of the other tools ask and by saying to prefer a typed tool when one fits.

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?

Explicitly directs the agent to call describe_dataset first, tells it to prefer a typed sibling when one fits, and defines the generic SQL-query use case. This gives both positive guidance and an exclusion criterion for alternatives.

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