Skip to main content
Glama
isdaniel

MySQL-Performance-Tuner-Mcp

analyze_query

Read-onlyIdempotent

Analyze MySQL query execution plans to identify performance bottlenecks, index usage, and optimization opportunities using EXPLAIN functionality.

Instructions

Analyze a MySQL query's execution plan using EXPLAIN.

Provides detailed analysis of:

  • Query execution plan with access types

  • Index usage and potential missing indexes

  • Join types and optimization opportunities

  • Rows examined estimates

  • Key usage and key length

Supports EXPLAIN FORMAT=JSON for MySQL 5.6+ for detailed cost analysis. Use EXPLAIN ANALYZE (MySQL 8.0.18+) for actual execution statistics.

WARNING: With analyze=true, the query is actually executed!

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe SQL query to analyze
analyzeNoUse EXPLAIN ANALYZE to get actual execution stats (MySQL 8.0.18+)
formatNoOutput format for the execution planjson
Behavior4/5

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

Annotations already indicate readOnlyHint=true, idempotentHint=true, and destructiveHint=false, but the description adds critical behavioral context with the WARNING about query execution when analyze=true, which is not covered by annotations. It also mentions version-specific features (MySQL 5.6+, 8.0.18+), enhancing transparency beyond the structured data.

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 well-structured and front-loaded with the core purpose, followed by bullet points detailing analysis aspects and version-specific usage notes, ending with a critical warning. Every sentence adds value without redundancy, making it efficient and easy to parse.

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 complexity of query analysis and the lack of an output schema, the description does a good job covering what the tool analyzes (execution plan, index usage, etc.) and behavioral nuances (version support, warning). However, it could be more complete by briefly mentioning the return format or typical output structure, though annotations help mitigate this gap.

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?

With 100% schema description coverage, the input schema already documents all parameters thoroughly. The description adds minimal value by implicitly linking 'analyze' to EXPLAIN ANALYZE and 'format' to output options, but does not provide significant additional semantics beyond what the schema descriptions already state.

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 specific action ('analyze a MySQL query's execution plan using EXPLAIN') and resource ('MySQL query'), distinguishing it from sibling tools like analyze_statements or get_slow_queries by focusing on execution plan analysis rather than performance monitoring or error detection.

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 context for when to use specific features (e.g., 'Supports EXPLAIN FORMAT=JSON for MySQL 5.6+', 'Use EXPLAIN ANALYZE (MySQL 8.0.18+)'), but does not explicitly state when to use this tool versus alternatives like get_index_recommendations or find_unused_indexes for similar optimization 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/isdaniel/mysqltuner_mcp'

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