explain_query
Run PostgreSQL EXPLAIN or EXPLAIN ANALYZE to obtain a query execution plan, helping you identify and debug performance bottlenecks in SQL queries.
Instructions
Get query execution plan via PostgreSQL EXPLAIN (or EXPLAIN ANALYZE) to debug performance bottlenecks
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 | If true, runs EXPLAIN (ANALYZE, BUFFERS, VERBOSE) to measure actual execution time |