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 36 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.8/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: 5-statement cap, max_rows ≤ 500 default 100, 16 KB shared byte budget, 15 s timeout, single-statement/no-semicolon rule, and truncation reporting. It also discloses domain-specific semantics (dev-branch isolation, adoption polarity, version encoding) and error/empty-result behavior.

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?

Purpose and the describe_dataset prerequisite are front-loaded, and the bullet structure separates result handling, isolation, and polarity rules. It is dense and long, but nearly every sentence carries operational detail rather than 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?

With no output schema, the description carries the return-value burden and does so: it describes columns, rows-as-arrays, max_rows, the 16 KB cap, and the truncated flag. Combined with the isolation/polarity caveats, an agent has everything needed to query correctly.

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 real value beyond the schema by surfacing cross-cutting constraints (15 s limit, 16 KB budget, shared budget across statements, results ordered under results) that shape how sql/max_rows/statements should be used.

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 (run read-only DuckDB SELECTs) and resource (the dataset behind the other tools), and explicitly frames the scope as 'for a question none of them asks.' It differentiates from siblings by pointing to describe_dataset and telling the agent 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 says to call describe_dataset first, prefer a typed tool when one fits, and use statements rather than sql for multiple statements. It also gives conditional guidance for truncation (aggregate, filter, or use LIMIT/OFFSET) and where to take recipes.

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