Skip to main content
Glama
shibbirweb

mcp-db-read-only

by shibbirweb

Run Read-Only SQL Query

run_query
Read-onlyIdempotent

Execute read-only SQL queries (SELECT, WITH, SHOW, DESCRIBE, EXPLAIN) across multiple database engines without modifying data.

Instructions

Execute a read-only SQL query (SELECT, WITH, and the engine's SHOW, DESCRIBE or EXPLAIN) on a MySQL, MariaDB, PostgreSQL, SQLite, SQL Server or ClickHouse connection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSQL query to execute, in the active engine's dialect
databaseNoOptional database to read from for this call only, without changing the active connection

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and non-destructive behavior. The description adds value beyond annotations by specifying exactly which SQL statement types are allowed and which DB engines are supported, giving the agent a concrete behavioral contract for what the tool accepts. No contradictions found.

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?

One tightly packed sentence with no wasted words. The primary action and scope are front-loaded, followed by allowed statements and engine list. Every phrase 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?

With only two parameters, high schema coverage, and annotations covering the safety profile, the description is largely complete. It explains what statements are executed and on which engines. Minor omissions like result format, row limits, or single-statement constraints would be useful but are not critical for a read-only query tool, especially with no output schema defined.

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?

Input schema provides 100% coverage with descriptions for both 'query' and 'database', so the description needs no param-level detail. It adds general context about statement types and engines, which is useful but not required beyond the schema. Baseline 3 is appropriate.

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?

States a specific verb ('Execute'), a resource ('read-only SQL query'), enumerates allowed statement types (SELECT, WITH, SHOW, DESCRIBE, EXPLAIN), and lists supported engines. This clearly distinguishes it from sibling data-exploration tools, none of which execute arbitrary 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?

The description makes the tool's scope explicit (read-only SQL across listed engines), which implies when to use it: when arbitrary SQL querying is needed over a managed connection. It does not explicitly name alternatives or exclusions, but the read-only constraint and statement list effectively rule out write operations and non-SQL tools like redis_command.

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