Run a data-modifying SQL statement
run-statementExecute a single PostgreSQL INSERT, UPDATE, DELETE, or MERGE and report rows changed, rolling back the transaction if affected rows exceed maxRows or a table falls outside the allowlist.
Instructions
[PostgreSQL] Run one INSERT, UPDATE, DELETE or MERGE and report how many rows it changed. Exactly one statement; DDL, TRUNCATE, COPY and CREATE TABLE AS are refused. Every table it reads or writes must be inside this connector's allowlist. It runs inside a transaction with a row cap: if the statement turns out to affect more rows than maxRows, the whole transaction is rolled back and NOTHING changes — so set maxRows to what you actually intend to change, and read a cap error as "my WHERE clause was wider than I thought" rather than as a limit to raise blindly. An UPDATE or DELETE with no WHERE clause is refused unless you pass allowWholeTable: true, which is deliberately a separate decision from the SQL. Add RETURNING when you need to see what changed; returned cells are clipped at 2000 characters unless you pass fullValues: true. This tool cannot see inside triggers: a write to an allowed table may cascade to tables outside the allowlist, and the allowlist cannot stop that. Confirm destructive changes with the user before calling this.
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": "run-statement"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | One INSERT, UPDATE, DELETE or MERGE statement | |
| maxRows | No | Roll the whole statement back if it would affect more rows than this | |
| timeoutMs | No | Server-side statement timeout, in milliseconds | |
| fullValues | No | Return every cell whole instead of clipping each at 2000 characters. Set it only when you need a long text or JSON value in full: a page of large cells can make a very large response. | |
| allowWholeTable | No | Permit an UPDATE or DELETE with no WHERE clause. Off by default: a missing WHERE is far more often a mistake than an intention. `maxRows` still applies. |