Skip to main content
Glama
riefer02

mysql-db-reader

by riefer02

mysql_query

Read-onlyIdempotent

Execute read-only SQL queries with positional parameters to retrieve data from MySQL databases. Supports SELECT, JOINs, aggregations, and EXPLAIN plans.

Instructions

Run a read-only SQL query with optional positional parameters. For complex queries or when you need JOINs, aggregations, or filtering. Results are limited to 10,000 rows; use LIMIT for large tables.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA read-only SQL statement starting with SELECT, SHOW, DESCRIBE/DESC, EXPLAIN or WITH (select). Include LIMIT clause for large tables.
paramsNoPositional parameters for the query (use ? placeholders in SQL)
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds value beyond these by stating the row limit (10,000) and advising to include LIMIT for large tables. This provides practical behavioral context that the annotations alone do not.

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?

The description is concise, with two sentences plus a salient note about row limits. It front-loads the purpose and key guidelines, with no extraneous information.

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?

Given the absence of an output schema, the description appropriately covers the allowed SQL types (SELECT, SHOW, DESCRIBE, EXPLAIN, WITH select) and the row limit. It does not explain error behavior or response format, but the tool's structure (SQL in, rows out) is standard enough that this is acceptable.

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 schema fully documents both parameters. The description adds usage guidance (e.g., 'include LIMIT clause for large tables' for the sql parameter, and 'use ? placeholders' for params), which enriches the meaning beyond the schema's basic descriptions.

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 clearly states the tool runs a read-only SQL query with optional parameters. It distinguishes from sibling tools by specifying 'For complex queries or when you need JOINs, aggregations, or filtering', which contrasts with the more specialized sibling tools like mysql_list_databases.

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 provides clear guidance on when to use this tool (complex queries, JOINs, aggregations) and implies when not to (simpler operations). It also gives a practical constraint: 'Results are limited to 10,000 rows; use LIMIT for large tables.' However, it does not explicitly mention alternatives for simpler tasks.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/riefer02/mysql-db-reader'

If you have feedback or need assistance with the MCP directory API, please join our Discord server