Skip to main content
Glama

query

Run read-only SQL SELECT or PRAGMA statements against the code index to inspect files, exports, dependencies, and import relationships.

Instructions

Read-only SQL on the code index: SELECT or PRAGMA table_info(t). files(id, path, language, extension, size_bytes, line_count, summary, description, external_imports, import_lines, created_at, modified_at, indexed_at); exports(id, file_id, name, kind, description, signature, line); dependencies(id, source_id, target_id, symbols): source imports target. *_id = files.id; paths are absolute. Who imports X: dependencies d JOIN files t ON t.id=d.target_id JOIN files s ON s.id=d.source_id WHERE t.path LIKE '%X'. Exports of X: exports e JOIN files f ON f.id=e.file_id. Max 50 rows, 8 KB.

Input Schema

NameRequiredDescriptionDefault
sqlYesOne SELECT or PRAGMA table_info(t)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.1

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden, and it does disclose what matters: read-only enforcement, hard limits of 50 rows and 8 KB, and which statements are accepted. It does not say what happens when a write statement or oversized result is attempted (error vs truncation), which is the remaining gap.

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

Conciseness4/5

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

Nearly every clause earns its place: table catalog, join key, path semantics, two worked examples, and the limits. The single dense block would be more scannable with the schema and the examples separated, but there is little filler.

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 one-parameter free-form query tool with no annotations and no output schema, the definition supplies the schema, join conventions, canonical query patterns, and result limits. The missing piece is how results are returned (column naming, ordering, truncation behavior at the 50-row/8 KB cap).

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 goes well beyond by enumerating the actual tables, columns, and *_id join relationships that define the semantic space of the sql string. That catalog is what makes constructing a valid query possible; only the return shape of the result set is left unspecified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names the resource (the code index) and the action (read-only SQL SELECT/PRAGMA), which is specific enough to distinguish it from named operations. It never explicitly contrasts itself with who_imports or exports_in, so an agent could reasonably duplicate those sibling tools with hand-written SQL instead of being routed to 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?

The two example queries ('Who imports X', 'Exports of X') show what the tool can do but not when to prefer it over the dedicated who_imports and exports_in siblings that already exist. Usage is implied (an escape hatch for queries the fixed tools don't cover) rather than stated.

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