Skip to main content
Glama

db.query

Run SQL against an environment database. Returns up to 500 rows. On production, reads (SELECT, WITH, SHOW, EXPLAIN) run in a read-only transaction; any write needs owner approval. May return pending_approval: the owner is emailed a link to approve; tell them it is waiting, then poll approval.status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
envYesEnvironment: production, staging, or a preview name
sqlYes
paramsNo
projectYesProject name

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses the 500-row cap, that production reads run in a read-only transaction, that writes require owner approval, and the pending_approval/email/polling flow. Missing timeouts, rate limits, and error semantics, but this is far above baseline for a mutation-capable tool.

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?

Four tight sentences, front-loaded with the core action, then row cap, then the production policy, then the approval flow. No 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?

No output schema exists, so the description must cover returns; it names the row limit and the pending_approval case, which is the highest-risk outcome. It stops short of describing the normal result shape or error responses, so it is good but not fully self-contained.

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 coverage is 50%, and the description meaningfully clarifies the env parameter by tying 'production' to read-only transactions and approval-gated writes. However it says nothing about the undocumented params array (bind parameters) or the project scoping, leaving half the parameters to inference.

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?

States a specific verb and resource ("Run SQL against an environment database") and scopes the target (environment database). It doesn't explicitly contrast with siblings like db.migrate or db.snapshot, but the operation is unambiguous.

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?

Explains the production read/write split and names the follow-up tool (approval.status) with the condition that selects it. It lacks guidance on when to prefer this over db.connection or env.exec, but the production gating is genuinely actionable.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources