Skip to main content
Glama
MCP-MySQL-Ops

MCP-MySQL-Ops

by call518

get_slow_queries

Retrieves slow queries with execution statistics from MySQL Performance Schema to diagnose performance issues and identify queries for optimization.

Instructions

[Tool Purpose]: Get slow queries from Performance Schema

[Exact Functionality]:

  • Show slowest queries with execution statistics

  • Display query text, execution count, and timing information

  • Show rows examined and returned

  • Order by total execution time

[Required Use Cases]:

  • When user requests "slow queries", "performance analysis", "query optimization"

  • When diagnosing performance issues

  • When identifying problematic queries

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_slow_queries"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of queries to return (default: 20)
database_nameNoDatabase name to connect to (uses default if omitted)

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

No annotations exist, so the description carries full behavioral burden. It does disclose the ordering semantics (by total execution time) and the metrics returned, but omits operationally important traits: that it requires the Performance Schema to be enabled, and that results are bounded by the Performance Schema buffer/summary retention.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded purpose statement followed by scannable buckets, so an agent can parse it quickly. The bracketed section headers and the "Show slowest queries" / "Order by total execution time" lines partially restate each other, which is minor overhead rather than real waste.

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 two optional parameters fully documented, an output schema covering return values, and explicit data content and ordering described, an agent has what it needs to invoke correctly. The only meaningful omission is the Performance Schema prerequisite, which is a runtime caveat rather than a selection 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?

Schema description coverage is 100%, so both limit and database_name are already documented in the schema, making 3 the baseline. The description reinforces the notion of "slowest" and ordering, but adds no format, range, or tie-breaking detail beyond what the schema states.

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+resource ("Get slow queries from Performance Schema") and enumerates exactly what is returned: query text, execution count, timing, rows examined and returned, ordered by total execution time. It is clearly distinguishable from sibling tools like get_active_connections and get_table_io_stats, which describe different data sets.

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 "Required Use Cases" block gives explicit trigger phrases ("slow queries", "performance analysis", "query optimization") and diagnostic contexts, so an agent knows when to reach for it. It stops short of 5 because no alternatives or when-not-to-use conditions are named.

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