Skip to main content
Glama

query

Run read-only SQL SELECT statements over v_entities, v_relations, and v_facts to answer analytical questions that structured entity/count filters cannot express.

Instructions

Run a read-only SQL SELECT over the curated views (v_entities, v_relations, v_facts) — the analytical escape hatch for questions the structured entities/count filters can't express. Single statement, SELECT/WITH only; writes are rejected and impossible. Run introspect for the view columns. Scope: results default to project+personal; pass scopes:["team"] to include team rows. The views are pre-filtered to the requested scopes before your SQL runs — no WHERE scope = … clause needed.

Input Schema

NameRequiredDescriptionDefault
sqlYesA single read-only SELECT (or WITH … SELECT) statement. Query the curated views: v_entities, v_relations, v_facts (run introspect for their columns). Writes, multiple statements, PRAGMA/ATTACH and DDL are rejected; the connection is read-only regardless.
limitNoMaximum rows to return. Defaults to 200, hard-capped at 1000. Rows beyond the cap set truncated=true.
scopesNoScope filter: which data partitions to include. Allowed values: project, personal, team. Defaults to [project, personal] when omitted — team rows are hidden unless you pass scopes:["team"]. The curated views are pre-filtered to the requested scopes before your SQL runs, so no WHERE scope = … clause is needed.

Output Schema

NameRequiredDescriptionDefault
rowsYesResult rows as column→value objects.
columnsYesResult column names in order.
rowCountYesNumber of rows returned (after the limit cap).
truncatedYesTrue when more rows matched than the limit returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so well: single SELECT/WITH statement only, writes rejected, read-only connection, scopes pre-filtered, and no WHERE scope clause needed. These are exactly the safety and execution traits an agent needs.

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?

Front-loads the core purpose and safety constraints, then adds scope behavior efficiently. Every sentence contributes operational context without redundant restatement of the schema.

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?

Given the output schema and fully described parameters, the description is complete enough to call the tool correctly. It covers the SQL surface, safety constraints, scope semantics, and the dependency on introspect for column knowledge.

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 useful meaning beyond the schema by explaining that the views are pre-filtered to the requested scopes and by directing the agent to introspect for columns.

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 a read-only SQL SELECT over curated views. It explicitly positions the tool as an analytical escape hatch for questions the structured entities/count filters cannot express, which distinguishes it from sibling tools.

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?

Gives a clear use condition—questions that structured entity/count filters cannot express—and points to introspect for view columns. It also explains scope defaults and how to include team rows, leaving little ambiguity about when and how to use it.

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