Skip to main content
Glama

ava_query

Read-only

Run read-only SQL against a loaded dataset's schema to compute comparisons, contributions and ratios, returning a queryId for artifact evidence.

Instructions

Execute read-only SQL in the source engine dialect from ava_schema (DuckDB, ClickHouse or PostgreSQL) and return queryId for artifact evidence. The latest 32 results and exact SQL are retained in this connection. Check truncation and scope. Closing the connection clears this cache; save needed evidence first. Semantic metadata does not rewrite SQL. Timed-out operations may still run; do not automatically retry or dispose an uncertain session. Apply confirmed definitions and compute comparisons and ratios in SQL. Reconcile category contributions with totals; leave zero-denominator growth undefined and identify new categories separately. SQL LIMIT or Top N can omit data even without a truncation flag. Distinguish observed changes and arithmetic contributors from causes; state evidence gaps before business advice. Give units, scope and material limitations with the answer.

Input Schema

NameRequiredDescriptionDefault
sqlYesOne read-only SELECT or CTE using tables and fields from ava_schema; at most 512 KiB
maxRowsNoReturned row limit, default 200. Check truncated; prefer aggregation for complete results
datasetIdYesID returned by ava_source in this MCP connection

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the readOnly/destructive hints, it discloses real behavioral traits: only the latest 32 results and exact SQL are retained per connection, closing the connection clears that cache, and timed-out operations may still be running so retries are unsafe. These are exactly the session-lifecycle details an agent cannot infer from annotations.

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

Conciseness3/5

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

The purpose and caching rules are correctly front-loaded, but the tail half drifts into analytic-reporting doctrine (reconciling category totals, zero-denominator growth, causes versus contributors, units and limitations) that is not about selecting or invoking this tool. Roughly a third of the text could be removed without losing invocation guidance.

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 still covers the return value (queryId), the truncation signal, and evidence retention, so an agent knows what to do with results. It is slightly over-stuffed with analytical caveats but nothing essential for calling the tool correctly is missing.

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 both sql and maxRows are already documented, including the default of 200 and the 512 KiB cap. The description adds limited extra meaning, mainly the warning that SQL LIMIT or Top N can silently omit data even without a truncation flag, which enriches maxRows semantics slightly. Baseline 3 is appropriate.

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 opening sentence states a specific verb and resource ('Execute read-only SQL in the source engine dialect from ava_schema'), names the supported engines, and specifies the return value ('queryId for artifact evidence'). That clearly separates it from ava_schema (metadata), ava_check, and ava_artifact.

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

Usage Guidelines4/5

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

It gives concrete operating conditions: check truncation and scope, save evidence before closing the connection, do not retry timed-out operations or dispose an uncertain session, and compute ratios in SQL. What it does not do is explicitly route between siblings (e.g. validating SQL with ava_check first, or visualizing via ava_viz); the dependency on ava_source for datasetId is only implied through the schema.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.