explain_query
Get the execution plan for a SQL query to analyze performance. Optionally run EXPLAIN ANALYZE to execute the query and see actual run times.
Instructions
Return an EXPLAIN plan for a query. ANALYZE executes the query.
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 | SQL query to explain | |
| analyze | No | Run EXPLAIN ANALYZE (executes the query). Limited in read-only mode. | |
| format | No | Output format for the execution plan | text |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |