Skip to main content
Glama
mcp-readonly-db

mcp-readonly-db

Run a read-only SQL query

run_query
Read-onlyIdempotent

Execute one read-only SQLite SELECT statement to inspect local database data; writes are rejected, ? placeholders handle values, and row/time limits apply.

Instructions

Run ONE read-only SQLite SELECT statement (WITH ... SELECT is fine). Writes, PRAGMA, ATTACH, comments and multiple statements are rejected. Use ? placeholders with the params array instead of pasting values into SQL. Results are capped at a row limit and queries are time-limited.

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": {
      "sql": "<sql>"
    },
    "name": "run_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesA single SELECT statement
limitNoMax rows to return (capped by the server row limit)
paramsNoValues for ? placeholders, in order

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnlyHint, idempotentHint, destructiveHint false), yet the description still adds real operational detail: the exact rejection rules, the one-statement constraint, row capping, and a server-side time limit. These are execution behaviors an agent cannot get from the structured fields and that affect how it should shape queries.

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 sentences, front-loaded with the core constraint and followed by the rejection list and binding advice. No filler or restatement of the title, and each sentence carries a distinct rule.

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?

With no output schema, the description still signals the result shape indirectly (rows capped by a server limit, query time-limited), which is the main thing an agent needs to know. It omits how rejections or errors are surfaced, a minor gap for a single-purpose query tool.

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 a usage rule the schema does not state: bind values through ? placeholders with the params array rather than embedding literals in the SQL string. That links the sql and params parameters semantically instead of leaving them as independent fields.

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?

Names a specific verb and resource ("Run ONE read-only SQLite SELECT statement") and pins the scope tightly with "WITH ... SELECT is fine" plus an explicit reject list. This clearly separates it from the introspection siblings (describe_table, list_tables, sample_rows), which take no free-form SQL.

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?

Gives concrete when-not conditions: writes, PRAGMA, ATTACH, comments and multi-statement SQL are rejected, and it prescribes parameterization via ? with the params array instead of inlining values. It lacks explicit routing to siblings (e.g., "use sample_rows for a quick peek"), so an agent must infer that this is the tool for arbitrary filtering that the fixed-shape siblings cannot express.

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

Deploy Server

Other Tools