Skip to main content
Glama
isdaniel

MySQL-Performance-Tuner-Mcp

get_slow_queries

Read-onlyIdempotent

Identify and analyze slow MySQL queries using performance_schema data to optimize database performance by examining execution times, row statistics, and query patterns.

Instructions

Retrieve slow queries from MySQL performance_schema.

Returns the top N slowest queries with detailed statistics:

  • Total execution time

  • Number of calls

  • Average execution time

  • Rows examined vs rows sent

  • Full table scans

  • Temporary tables usage

Requires performance_schema to be enabled (default in MySQL 5.6+). For older versions, use the slow query log instead.

Note: This tool excludes queries against MySQL system schemas (mysql, information_schema, performance_schema, sys) to focus on user/application query performance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of slow queries to return (default: 10)
min_exec_time_msNoMinimum total execution time in milliseconds (default: 0)
order_byNoColumn to order results bytotal_time
schema_nameNoFilter by schema/database name (optional)
Behavior4/5

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

Annotations already indicate read-only, non-destructive, and idempotent behavior, but the description adds valuable context: it specifies that queries against MySQL system schemas are excluded, which is a key behavioral trait not covered by annotations. However, it doesn't mention potential rate limits or authentication requirements.

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 details on returns, prerequisites, and exclusions. 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 tool's moderate complexity, rich annotations, and full schema coverage, the description is largely complete. It explains what the tool does, when to use it, and key exclusions, though without an output schema, it could benefit from more detail on return format or error handling.

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 fully documents all parameters. The description adds no specific parameter semantics beyond what's in the schema, so it meets the baseline of 3 without compensating for gaps.

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 ('Retrieve slow queries from MySQL performance_schema') and resource ('slow queries'), distinguishing it from siblings like 'get_active_queries' or 'get_statements_with_temp_tables' by focusing on performance metrics of the slowest queries rather than active queries or specific query patterns.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly provides when to use this tool ('Requires performance_schema to be enabled') and when not to use it ('For older versions, use the slow query log instead'), offering clear alternatives and context for its applicability.

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