preview_write
Preview the impact of UPDATE, DELETE, or INSERT statements by converting them into read-only SELECTs with affected-row counts, so you can review changes without executing the write.
Instructions
Dry-run a write WITHOUT writing: converts one UPDATE / DELETE / INSERT into the read-only SELECT that shows what it would do, plus a COUNT(*) of affected rows. The write statement itself is never sent to the database. UPDATE -> key columns + each SET column as '[col (current)]' / '[col (new)]' (changed_only=true hides no-op rows) DELETE -> the rows that would be removed (and which child tables reference them) INSERT -> the rows that would be added, under the target's column names run=true also executes the preview (read-only, row-capped) and returns the affected-row count and first rows. This server cannot apply the write; hand the reviewed statement to the user to run themselves.
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": "preview_write"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| run | No | ||
| sql | Yes | ||
| params | No | ||
| connection | No | ||
| changed_only | No |