Run a SQL write
db_executeRun a single INSERT, UPDATE, DELETE, or DDL statement on an approved agent-write connection; dry-run by default reports affected rows and rolls back before you commit.
Instructions
Runs one INSERT / UPDATE / DELETE / DDL statement on a connection the owner opened to agent writes (agentWrites in database/connections.json). Production-like connections are always refused; DROP, TRUNCATE, schema changes (CREATE / ALTER) and DELETE / UPDATE without WHERE are refused unless the owner's policy allows. dryRun (default true) runs the write in a transaction, reports rows affected and rolls back; pass dryRun:false to commit. Prefer setting up test data through the API under test when it can.
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": "db_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | One write statement | |
| dryRun | No | Default true: run, report, roll back | |
| params | No | Object for :name placeholders, or array for $1 / ? / @p1 | |
| connection | No | Name or id; optional when there is one |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | Yes | ||
| warnings | Yes | ||
| committed | Yes | ||
| elapsedMs | Yes | ||
| riskLevel | Yes | ||
| statement | Yes | Statement keyword, e.g. UPDATE | |
| connection | Yes | ||
| environment | Yes | ||
| rowsAffected | Yes |