explain_query
Returns the execution plan for a SELECT, TABLE, or VALUES statement without running it, highlighting full scans, filesort, temporary tables, and estimated rows so you can spot slow queries first.
Instructions
Returns the execution plan for one SELECT, TABLE or VALUES statement without running it: the EXPLAIN FORMAT=JSON document plus a summary (full table scans, filesort, temporary table, max estimated rows), or the TREE text. Use it before running a query that may be slow.
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 | One SQL statement. | |
| format | No | json | |
| database | No | Default database for unqualified table names. Omit if every name is qualified as db.table. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |