Skip to main content
Glama

query_data

Run a read-only SQL SELECT against the app's SQLite database to create a named dataset that boards can visualize.

Instructions

Run one read-only SQL SELECT against the app's SQLite database and keep the rows as a dataset named name that boards can draw. The database computes every number: aggregate, sort and round in SQL, not in your head. Returns the columns, the row count and the first rows. At most 5000 rows per query. Reusing a name replaces that dataset.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
nameYesDataset name boards will use, e.g. top_products
preview_rowsNoRows to return to you (default 15)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden well: read-only single SELECT, 5000-row cap, return shape (columns, row count, first rows), and that reusing a name replaces the existing dataset. It omits error behavior, timeouts, and permission requirements, but the core operational traits are disclosed.

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?

Four tight sentences, front-loaded with the action and resource, then the compute guidance, return shape, limits, and replacement semantics. Nothing redundant or padded.

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?

For a tool with no output schema and no annotations, the description covers return shape, row limits, and dataset-replacement behavior. Error handling and permission/scope expectations are the main missing pieces, but an agent has enough to invoke it 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 67%, and the description adds real meaning beyond the schema for the two most important parameters: `name` becomes the dataset boards draw and its reuse replaces the old dataset; `sql` must be one read-only SELECT. preview_rows semantics are left to its schema description, which is adequate.

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 one read-only SQL SELECT against the app's SQLite database') plus the side effect ('keep the rows as a dataset named `name` that boards can draw'). The dataset-materialization purpose clearly separates it from schema-inspection siblings like describe_data, even without naming them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied: it is the tool for computing numbers in SQL rather than 'in your head', and read-only SELECT signals its scope. However, it never names describe_data as the alternative for discovering schema, nor states when not to use it, so routing guidance 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.