Run SQL that changes data
execute_write_queryRun one SQL statement that changes data or structure (INSERT, UPDATE, DELETE, CREATE and so on) on a connection whose aiAccess is same_as_people, and return its result in the same shape as execute_query. Only use it when the user has asked for the change; for reading, use execute_query. Refused on every other connection, and on a connection the team made read-only for people too. DROP DATABASE, DROP SCHEMA and TRUNCATE are always refused. Counts against the company's monthly query quota and a limit of 30 queries per minute (the team can set a lower one per connection). Needs the execute scope and a member role that can edit. The team can require a person to approve some requests: the call then fails with code APPROVAL_REQUIRED and an approvalUrl. Show the user that link, wait until they say it is approved, then repeat the exact same call with approvalId. An approval works once, for that SQL, within 30 minutes.
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": {
"connectionId": "<connectionId>",
"sql": "<sql>"
},
"name": "execute_write_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL statement to run, in the connection's own dialect. | |
| approvalId | No | Only when repeating a call that came back with APPROVAL_REQUIRED, after the user approved it. Send the same arguments again. | |
| connectionId | Yes | Connection id from list_connections. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | No | ||
| success | No |