Skip to main content
Glama

Query MySQL

mysql_query
Read-onlyIdempotent

Run one parameterized read-only MySQL SELECT, WITH, SHOW, DESCRIBE, or EXPLAIN statement against a configured connection; writes are rejected and returned rows are capped.

Instructions

Run exactly one parameterized read-only MySQL statement. Works in every environment, including prod. Data MCP rejects writes, locking reads, file access, session mutation, multiple statements, and selected resource-exhaustion functions; it also runs the statement in a read-only transaction and caps returned data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesExactly one read-only MySQL SELECT, WITH, SHOW, DESCRIBE, or EXPLAIN statement. Use ? placeholders for values.
max_rowsNoMaximum rows returned to the model.
parametersNoPositional values for SQL ? placeholders. Values may be string, finite number, boolean, or null.
timeout_msNoClient-side query timeout in milliseconds, from 1000 through 120000.
connection_idYesConfigured connection ID, for example prod-main or test-main.
response_formatNoResponse rendering: markdown for humans or json for programmatic processing.markdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0-alpha.1

TDQS

A4/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnlyHint, idempotentHint, destructiveHint), but the description adds substantial non-obvious behavior: the exact rejection list (writes, locking reads, file access, session mutation, multiple statements, resource-exhaustion functions), the read-only transaction wrapping, and the returned-data cap. This is exactly the kind of enforcement detail an agent cannot get from annotations alone.

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?

Two dense sentences, front-loaded with the core action and immediately followed by the enforcement scope. No filler and no repetition of the title.

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?

For a complex SQL-execution tool with no output schema, the description covers the critical constraints (single statement, read-only, rejection list, data cap) that an agent needs to call it correctly. Minor gaps remain: error/failure behavior and the practical meaning of 'caps returned data' beyond max_rows are not spelled out.

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 all six parameters are already documented in the schema, including placeholder usage and limits. The description's mention of 'parameterized' and 'caps returned data' adds little beyond what the schema states, so the baseline 3 applies.

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 ('Run exactly one parameterized read-only MySQL statement') with a clear read-only scope qualifier. Sibling tools like mysql_execute are not named, so the agent must infer the read-only vs. write distinction rather than being routed explicitly.

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 description establishes context ('Works in every environment, including prod') and implicitly carves out a safe-use niche via the read-only framing. However, it never states when to choose this over mysql_execute or mysql_execute_transaction, so usage is implied rather than guided.

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