Skip to main content
Glama

Run a read-only SQL query

query
Read-onlyIdempotent

Use this when the user asks a question about data they keep in LakehouseBox, or to check a table after changing it. Run ONE read-only DuckDB SQL statement on the server over the catalogs you can read (SELECT, WITH … SELECT, DESCRIBE, SUMMARIZE, EXPLAIN), in DuckDB's SQL dialect (https://duckdb.org/docs/stable/sql/introduction). Name tables catalog.namespace.table; another organisation's PUBLIC catalog by its alias, _ (open_public_catalog gives it, e.g. commons_pubdata.reference.countries), or "/" in double quotes when the alias is ambiguous or starts with a digit; name every table in full when one is public. Rows come back as one object per row keyed by column name (format='arrays': each row a list in columns order, about half the size, for long results); columns gives every column's name and type. DECIMAL values are numbers when a double holds them exactly (15 significant digits); longer decimals and integers past 2^53 come back as text, so no digit is lost. Results are capped (default 200 rows, at most 2,000, ~50,000 characters; truncated says so, max_rows_applied gives the cap used) and each query has 20 seconds of compute in one queue shared by every tenant (no quota): aggregate and filter in SQL rather than fetching raw rows. busy means the queue or a concurrency limit is full (limit names it), rate_limited that queries came too fast for one key: wait retry_after_seconds before sending again. Timestamps come back ISO 8601 in UTC. An answer that read tables names each one's snapshot and commit time (snapshots: how fresh the data is) and says whether it came from the result cache (cache.hit; cache.not_cached says why it was not kept): a repeat of a query on tables nobody has committed to since is answered from it, for at most 15 minutes, or 60 s when the query uses the clock (now(), current_date); system views and table functions always run. dry_run=true runs nothing and says what it would read (rows, files, bytes per table, an upper bound) and whether the cache would answer. Heavier work belongs in your own DuckDB (lhbox duckdb) when you can run commands and reach s3.lakehousebox.com; an answer that hit a limit carries local_compute, what to tell the person when you cannot.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesone read-only statement in DuckDB SQL (https://duckdb.org/docs/stable/sql/introduction)
engineNoDuckDB engine version: '1.5' (DuckDB 1.5.6, default) or '2.0' (DuckDB 2.0 preview)
formatNoobjects (default): each row an object keyed by column name, what dashboards, BI tools and most code read; arrays: each row a list in `columns` order, about half the sizeobjects
dry_runNotrue: run nothing; say which tables it reads with their rows, data files and bytes (an upper bound from the metadata) and whether the cache would answer it
max_rowsNorows to return (default 200, at most 2000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / engine
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "1.5",
      +        "2.0"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "DuckDB engine version: '1.5' (DuckDB 1.5.6, default) or '2.0' (DuckDB 2.0 preview)",
      +  "title": "Engine"
      +}
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes far beyond the annotations (which already cover read-only/non-destructive): row and character caps, the 2000-row ceiling, the shared 20-second queue, busy/rate_limited error semantics with retry_after_seconds, cache TTLs and when caching is skipped, snapshot/commit freshness, and dry_run behavior. This is exactly the extra context annotations cannot carry.

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 when-to-use and the core verb, and nearly every clause carries independent information (naming rules, limits, errors, cache, fallback). It is a dense single block with no visual separation, which makes it harder to scan than it could be, but there is little pure padding.

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 complex, high-variance tool with no output schema, the description covers return shape (row objects vs arrays, columns), truncation signaling, freshness/snapshot metadata, caching, failure modes, and a compute-escalation path — everything an agent needs to invoke and interpret it correctly.

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 description coverage is 100%, so the schema already documents sql, engine, format, dry_run and max_rows. The description restates the same facts (format='arrays' ~half the size, dry_run introspection, default 200 / max 2000) rather than adding new parameter meaning, so the baseline 3 applies.

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 DuckDB SQL statement on the server over the catalogs you can read', and enumerates the allowed statement forms (SELECT, WITH … SELECT, DESCRIBE, SUMMARIZE, EXPLAIN). It is clearly separable from siblings like query_rw (read-only), open_public_catalog (source of aliases), and describe_table.

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?

Explicit when-to-use ('user asks a question about data they keep in LakehouseBox, or to check a table after changing it') plus an explicit alternative for heavy work (run your own DuckDB via lhbox duckdb when you can reach s3.lakehousebox.com) and a pointer to open_public_catalog for cross-organisation naming. Nothing is 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.

Resources