Skip to main content
Glama

db_query

Read-onlyIdempotent

Read from this workspace's own database. Pass either a natural-language question (e.g. 'how many records were added this week') or a raw SQL SELECT. Read-only; returns rows plus a chart hint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlNoRaw SQL SELECT (alternative to question)
questionNoNatural-language question about the data
in_workspaceNoRun this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / in_workspace
      Added value: +{
      +  "description": "Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.",
      +  "type": "integer"
      +}
  2. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the bar is lower, yet the description adds real value: it confirms read-only behavior, restricts input to a SELECT, and discloses the return shape ('rows plus a chart hint'). It stops short of noting rate limits, permissions, or result limits.

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 short, front-loaded sentences with zero filler: destination, input modes, and constraints/returns in order of importance. Every sentence earns its place.

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 3-param read-only tool with no output schema, the description covers purpose, input modes, read-only constraint, and a rough return shape. It is nearly complete, lacking only explicit differentiation from sibling data tools and any limits on result size.

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 meaning by framing sql and question as mutually exclusive alternatives and giving a concrete example of the natural-language question. The workspace-scoping nuance of in_workspace is left to the schema.

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 states a specific verb (read) and scoped resource (this workspace's own database), and clarifies the two accepted input modes. It implicitly contrasts with the write-oriented siblings db_execute/db_create via 'Read-only', but never names those siblings explicitly.

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?

It tells the agent how to call it ('Pass either a natural-language question ... or a raw SQL SELECT') but gives no when-to-use vs alternatives guidance, e.g. when to prefer db_query over analytics_query, db_schema, or db_execute. Usage is implied rather than stated.

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.