Skip to main content
Glama
Esaban17

mcp-mysql-database

by Esaban17

run_query

Read-only

Execute read-only SQL SELECT/SHOW/DESCRIBE/EXPLAIN/WITH queries in a READ ONLY transaction, returning up to 1000 rows. Use ? placeholders with params.

Instructions

Ejecuta una consulta SQL de SOLO LECTURA (SELECT/SHOW/DESCRIBE/EXPLAIN/WITH) dentro de una transacción READ ONLY. Máx. 1000 filas devueltas. Usa ? y params para valores.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
paramsNo
databaseNoBase de datos a usar (por defecto la actual de la conexión activa)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true, and the description is consistent with that while adding real behavioral context: the query runs inside a READ ONLY transaction and results are capped at 1000 rows. It stops short of describing error handling or what happens on a rejected statement type.

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, each carrying a distinct constraint: allowed statements, transaction/row-limit behavior, and parameter binding. The most decision-relevant fact (read-only) is front-loaded with no filler.

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 usefully discloses the 1000-row cap and the read-only transaction guarantee, which is what an agent most needs. Gaps remain around failure modes (what error a disallowed statement produces) and connection scoping, but the core call contract is covered.

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 only 33% (only `database` is documented), so the description must compensate, and it does for `params` by stating the `?` placeholder convention for binding values. The `sql` parameter's meaning is conveyed only indirectly via the statement whitelist, so it is not fully covered.

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 (Ejecuta) plus resource (consulta SQL) and pins the scope with an explicit statement whitelist (SELECT/SHOW/DESCRIBE/EXPLAIN/WITH) executed in a READ ONLY transaction. This immediately separates it from write-oriented siblings like execute_sql, insert_records, or update_records even without naming them.

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?

The read-only framing implies when the tool applies, and the allowed-statement list effectively excludes writes. However, it never states the alternative explicitly (e.g., 'use execute_sql for writes') or any prerequisite such as which connection must be active, leaving routing to inference.

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