Explain Query Plan
explain_queryRun MySQL EXPLAIN or EXPLAIN ANALYZE on read-only SELECT, WITH, or TABLE statements to inspect query execution plans and collect optional real timings.
Instructions
Run MySQL EXPLAIN (or EXPLAIN ANALYZE) on a read-only SELECT and return the plan.
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
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SELECT, WITH or TABLE statement to explain | |
| analyze | No | Use EXPLAIN ANALYZE and execute the SELECT to collect real timings (default false) | |
| jdbc_url | No | Optional JDBC URL to target a specific database (credentials embedded in URL); uses environment default when omitted |