Skip to main content
Glama
shibbirweb

mcp-mysql-read-only

by shibbirweb

Run Read-Only Query

run_query
Read-onlyIdempotent

Execute read-only SQL queries (SELECT, WITH, SHOW, DESCRIBE, EXPLAIN) against a MySQL database.

Instructions

Execute a read-only SQL query (SELECT, WITH, SHOW, DESCRIBE, EXPLAIN only) against the active connection

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.5

TDQS

A4.2/5.0
Behavior3/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 covered. The description adds the allowed statement set and the active-connection scope, which is useful behavioral context, but it doesn't disclose error behavior, result size limits, or the consequence of having no active connection.

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 sentence that front-loads the core operation ('Execute a read-only SQL query'), immediately constrains allowed statements, and states the target. There is no filler, repetition, or unnecessary detail.

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?

The description, combined with rich annotations and fully described parameters, covers the essential invocation details: required query, allowed statement types, optional database override, and the active-connection prerequisite. It omits result format and pagination, which is a minor gap for a query execution tool, but overall an agent has enough to call it correctly.

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 description coverage is 100%, so the baseline is 3. The description adds meaning by constraining the 'query' parameter to SELECT, WITH, SHOW, DESCRIBE, and EXPLAIN, which is stronger than the schema's generic 'SQL query to execute'. The 'database' parameter is already well described in the schema, so the net addition is moderate but valuable.

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?

The description states a specific verb ('Execute'), a precise resource ('read-only SQL query'), enumerates the allowed SQL statement types, and anchors it to the active connection. This clearly differentiates it from sibling metadata tools like describe_table or list_tables by framing it as arbitrary SQL rather than a structured listing.

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 gives clear context for when to use the tool: whenever a read-only SQL query needs to run against the active connection.page The explicit allowlist of SQL verbs provides implicit exclusion of write queries Mend. However, it does not name sibling alternatives or state when to prefer them, so it stops short of fully explicit routing.

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