Skip to main content
Glama

Run a read-only query

query
Read-onlyIdempotent

Run one read-only SQLite SELECT and return columns and rows as JSON, capped at 200 rows, while enforced access policies and automatic row-level filtering keep results compliant.

Instructions

Run one read-only sqlite SELECT and return columns and rows as JSON, at most 200 rows. Writes, other statements, tables or columns outside the policy and dangerous functions are rejected with the reason: fix the query and try again. Rows are filtered for the current user automatically; don't add those filters yourself.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sql": "<sql>"
    },
    "name": "query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesOne SELECT query, in the dialect list_tables reports

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0-alpha.8

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, non-destructive), the description discloses the 200-row cap, that policy violations are rejected with a reason, and that row-level filtering for the current user happens automatically. These are operational facts an agent cannot derive from schema or annotations, and they directly change how it should behave.

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 tight sentences: capability and limits first, rejection behavior second, the non-obvious filtering caveat last. No filler and every clause carries information an agent needs before writing SQL.

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 single-parameter read tool with full annotation coverage and an output schema, this covers everything relevant: dialect source, statement restriction, row cap, rejection semantics, and implicit user filtering. Return values are handled by the output schema, so nothing critical is missing.

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, but the description adds real meaning: the dialect is defined by what list_tables reports, exactly one statement is allowed, and the agent must not manually add user-scoping filters to the SQL. That last point materially changes how the single parameter should be authored.

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 sqlite SELECT') plus the return shape ('columns and rows as JSON, at most 200 rows'). It also implicitly separates itself from siblings by pointing at list_tables as the authority for the dialect, so an agent can tell this apart from explain_query or 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 Guidelines4/5

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

Clearly bounds usage: only SELECT statements are accepted, writes and other statements are rejected, and the recovery path is given ('fix the query and try again'). It also warns not to add user filters since rows are filtered automatically. It does not explicitly say when to prefer explain_query or describe_table instead, so it stops short of a 5.

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