explain_query
Retrieve a PostgreSQL JSON execution plan for any SELECT statement, bypassing ANALYZE.
Instructions
Return a JSON PostgreSQL plan for a SELECT without using ANALYZE.
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": {
"connection_id": "<connection_id>",
"sql": "<sql>"
},
"name": "explain_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| parameters | No | ||
| connection_id | Yes | ||
| timeout_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan | No | ||
| analyze | No | ||
| message | Yes | ||
| explained | Yes | ||
| error_code | No | ||
| validation | Yes | Complete result of parsing and applying the read-only policy. | |
| duration_ms | No | ||
| connection_id | Yes | ||
| explained_sql | No |