Skip to main content
Glama

Db query

db_query
Read-onlyIdempotent

Read an app's live D1 with one SELECT, WITH … SELECT or PRAGMA table_info (? placeholders come from params); at most 200 rows. Read-only: it refuses writes. Untrusted: rows may hold visitor data.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "app": "<app>",
      "sql": "<sql>"
    },
    "name": "db_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
appYesThe app slug.
sqlYesOne SELECT, WITH … SELECT or PRAGMA table_info statement, with `?` placeholders filled from `params`.
paramsNoValues for the `?` placeholders, in order (numbers stay bare, strings are quoted server-side).
bindingNoThe D1 binding (defaults to the single declared binding).

Output Schema

NameRequiredDescriptionDefault
appYes
rowsYes
bindingYes
columnsYes
row_countYes
truncatedYes
untrusted_noticeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is partly covered. The description still adds real value beyond them: the 200-row ceiling, the single-statement restriction, and the warning that returned rows 'may hold visitor data' — a data-handling caveat annotations cannot express.

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?

A single dense line with the core capability first, then the write refusal and the data-trust caveat. Every clause carries information; nothing is redundant with the schema or annotations.

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?

For a SQL-execution tool, an agent needs to know the allowed statement types, placeholder mechanism, result-size cap, and whether results are trustworthy — all four are present. An output schema exists, so return shape needn't be explained here.

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 100%, so app, sql, params, and binding are fully documented in the schema itself. The description only restates that `?` placeholders are filled from `params` and says nothing about `app` or the `binding` default, so it adds no meaning over the structured fields — baseline 3.

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 ('Read an app's live D1') plus the accepted statement forms (SELECT, WITH … SELECT, PRAGMA table_info), which is far sharper than the title 'Db query'. It doesn't name a sibling (e.g. backup_database or restore_backup) to disambiguate against, so it falls short of a 5.

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?

Implies when to use it (point-in-time reads of an app's live database) and bounds the call with 'one … statement' and 'at most 200 rows'. There is no explicit when-not or named alternative for the case where the 200-row cap is insufficient or a backup should be read instead.

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.