Check SQL
check_sqlEvaluate SQL against this workspace's rules before it runs. Pass a whole script (e.g. a migration file) as sql and the server splits it into statements, reporting each with the line it starts on. Or pass pre-split queries. Each statement evaluated costs one check from the monthly allowance; a call that needs more checks than remain is rejected whole. Returns a compact verdict: findings for every statement that is not ALLOWED, each with its rule code and a suggested fix, and next_steps: what to do next for each statement (run it, run the approved_query, apply the fix and check again, or stop and ask the user). Follow next_steps instead of rephrasing a blocked statement and checking it again.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "check_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | No | A whole SQL script. Split server-side; costs one check per statement. Use this OR queries. | |
| ticket | No | The change ticket this SQL runs under (e.g. OPS-123). Declared, not verified; recorded with the check. | |
| dialect | No | Dialect of the database the SQL targets. Defaults to postgres — pass it explicitly; whoami lists this workspace's databases and their dialects. Common aliases (postgresql, pg, mariadb, sqlserver…) are accepted and reported as the canonical id. | |
| queries | No | Pre-split statements; costs one check each. Use this OR sql. | |
| verbose | No | Return the full CLI-compatible result (every query, latencies) instead of the compact verdict. | |
| file_name | No | Source file, shown in the report history. | |
| database_id | No | The database the SQL targets (whoami lists them). Its sensitive-column tags apply; without it, every database tag in the workspace does. This key's agent access policy on that database applies too; required when the key has policies on several databases. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| passed | Yes | ||
| dialect | Yes | ||
| summary | Yes | ||
| findings | Yes | ||
| report_id | No | /mcp/account: the stored report (show_report). | |
| next_steps | Yes | What to do next, by statement line: which tool to call, or that no call will help. Follow it instead of retrying. | |
| kill_switch | No | ||
| next_action | Yes | The most important next step: the first of next_steps. | |
| evaluated_as | Yes | ||
| ruleset_version | Yes | ||
| ci_checks_remaining | No |