Check SQL without running it
validate_queryCheck SQL syntax without executing it, returning validity, statement type, and errors. Detect slow queries via EXPLAIN before running writes or debugging failures.
Instructions
Check whether a SQL statement parses, without running it, and return {valid, statement_type, errors}. With include_plan=true, a SELECT also returns its execution plan (EXPLAIN), which helps spot slow queries. Use it before execute on writes you want to be sure of, or to debug a failing query; it never changes data.
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": "validate_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL statement to check (any statement type). | |
| include_plan | No | true = also return the execution plan; applies to SELECT statements (default false). |