explain_query
Returns the JSON execution plan for a SQL statement via EXPLAIN. Set analyze=True to execute read-only SQL and capture real row counts and timing.
Instructions
[READ] Return the JSON execution plan for sql (EXPLAIN).
analyze=False (default) plans without executing; analyze=True runs the
statement to collect real timing — only use it for read-only SQL.
Args:
sql: A single SQL statement to EXPLAIN.
analyze: If True, execute the statement to gather real row counts/timing.
target: Target name from config; omit for the default.
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 | ||
| target | No | ||
| analyze | No |