explain_query
Analyze SQL query performance by retrieving execution plans from Postgres, MySQL, or SQLite databases. Identify and resolve slow queries efficiently.
Instructions
Run EXPLAIN ANALYZE (Postgres) or EXPLAIN (MySQL/SQLite) on a SELECT query to show the execution plan. Useful for diagnosing slow queries.
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 | SELECT statement to explain | |
| params | No | Positional parameters matching the query | |
| connection | No | Named connection to use. Defaults to the default connection. |