Skip to main content
Glama

Run a read-only SQL query

run_sql
Read-onlyIdempotent

Execute raw SQL queries against the Engine DJ library to answer questions the other tools don't cover, from custom searches to audits. Read-only enforced.

Instructions

Escape hatch for questions the other tools do not cover. Read-only is enforced by the kernel, not by this check alone. Use side.track_derived.camelot and side.track_derived.tempo in WHERE clauses rather than the camelot()/tempo() SQL functions, which run per row and defeat indexes. With more than one library connected, pass library (a uuid or path from list_libraries, either the ~/... form or the absolute one) to choose which one; the default is the supported library with the most tracks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
limitNo
paramsNo
libraryNoWhich library to use: either the uuid or the path reported by list_libraries (the reported ~/... form is accepted, as is the absolute path). Omit it to use the supported library holding the most tracks. A READ may always omit it. A WRITE may omit it only when a single supported library is connected: with two or more, a write refuses with ambiguous_library listing them, since the choice decides which disk changes; ask the user which, then pass it here. A library copied onto another drive keeps its uuid, so a uuid can name two connected libraries: a write naming such a uuid refuses with ambiguous_library as well. Pass the path to write to one of them.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.17.2

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive behavior, so the safety profile is covered. The description adds valuable behavior beyond annotations: read-only is enforced by the kernel, not just by the tool's own check, and the SQL functions defeat indexes. It does not detail output shape or error behavior, but the annotations lower the burden here.

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?

The description is dense but front-loaded: purpose comes first, then the read-only enforcement caveat, then performance guidance, then library disambiguation. Every sentence earns its place. The library-selection sentence is long, but the complexity justifies it. No filler or redundant restating of annotations.

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 powerful SQL escape hatch, the description covers the most decision-relevant facts: scope, safety enforcement, performance pitfalls, and library disambiguation. There is no output schema, but the return value of a SQL query is reasonably implicit. It does not mention result limiting or parameter binding syntax, though those are partly visible in the schema.

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 only 25% (only `library` has a rich description). The tool description compensates for `sql` by explaining its role and advising on WHERE-clause table usage, and it clarifies `library` selection and defaults. However, `limit` and `params` are left to the schema's minimal type/default info, so the description does not fully compensate for the low coverage.

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 action and resource: 'Run a read-only SQL query' and positions itself as an 'escape hatch for questions the other tools do not cover.' This clearly distinguishes it from the sibling query tools and leaves no doubt about what the tool does.

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?

It explicitly says when to use the tool (when other tools do not cover the question) and gives concrete routing guidance for performance ('Use side.track_derived... rather than camelot()/tempo()') and library selection when more than one library is connected. This is actionable, not merely contextual.

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