Skip to main content
Glama

query_sql_report

Read-onlyIdempotent

Run read-only SQL rowset queries over authorized datasets to generate wide reports. Returns columns, rows, row count, truncation status, and latency.

Instructions

Execute a constrained read-only SQL rowset query over authorized datasets. Use this only for wide reports that do not fit the governed exact-query surface. SQL must be a single SELECT/WITH statement over the provided dataset aliases. Returns columns, rows, row_count, truncated, request_id, and latency_ms.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSingle read-only SELECT or WITH statement.
sourcesYesAuthorized datasets made available to the SQL report.
max_rowsNoOptional row cap, up to the API maximum.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds useful behavioral context by stating SQL must be a single SELECT/WITH statement over provided dataset aliases and by listing the exact return fields (columns, rows, row_count, truncated, request_id, latency_ms). This goes beyond annotations without contradicting them.

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?

Three sentences, no filler, and the most important constraint is front-loaded ('constrained read-only SQL rowset query'). Every sentence adds either scope, usage, or return information. The structure is tight and scannable.

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 SQL query tool with no output schema and only 3 parameters, the description is complete. It covers the operation type, usage boundary, SQL syntax constraint, dataset scoping, and return fields. The annotations handle the safety profile. An agent has enough information to select and invoke the tool correctly without guessing.

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 description coverage is 100%, so the baseline is 3. The description adds value by constraining the sql parameter to a 'single SELECT/WITH statement over the provided dataset aliases,' which clarifies how sources and aliases relate to the query. It also explains the return shape, giving the agent more operational understanding than the schema alone.

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 description states a specific verb and resource: 'Execute a constrained read-only SQL rowset query over authorized datasets.' It further distinguishes itself from sibling tools by saying it is for 'wide reports that do not fit the governed exact-query surface,' which differentiates it from governed query tools like query_data. An agent can tell what this tool does and roughly when it applies.

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?

The description gives an explicit trigger condition: 'Use this only for wide reports that do not fit the governed exact-query surface.' The word 'only' implies exclusion of exact/governed query use. However, it does not name the specific sibling tool (e.g., query_data) as the alternative, so the guidance is clear but not maximally explicit.

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

Deploy Server

Other Tools