Skip to main content
Glama
MySQL MCP Server

MySQL MCP Server

Explain Query

explain_query

Analyze SQL query performance by retrieving the execution plan. Identify bottlenecks and optimize queries.

Instructions

获取SQL查询的执行计划,用于分析查询性能

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sql": "<sql>"
    },
    "name": "explain_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes需要分析的SQL查询语句
databaseNo可选,指定数据库

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. '获取执行计划' conveys a read-only diagnostic action, but it does not explicitly state whether the query is executed, whether there are side effects, or any cost/performance implications beyond the purpose.

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?

One concise sentence in Chinese that front-loads the operation and purpose. There is no filler or redundant restatement of the tool name/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 two-parameter tool with a documented output schema, the description is largely sufficient: it states what the tool does and when it is useful. It could add a note about not modifying data, but the read-only nature is strongly implied by '获取执行计划'.

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 the schema already documents the sql and database parameters. The description does not add parameter-level semantics beyond the purpose, matching the baseline for high coverage.

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?

The description uses a specific verb ('获取') and resource ('SQL查询的执行计划'), and adds the purpose '用于分析查询性能'. This clearly identifies the tool as an explain/plan analysis utility rather than a data-returning query tool, though it does not explicitly name sibling tools.

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?

It explicitly states the context: analyzing query performance. It does not provide exclusions or compare itself to alternatives like query or execute_write, so it misses the explicit when/when-not guidance, but the stated purpose gives clear context.

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