database_execute
Runs a SQL script (INSERT, UPDATE, DELETE, DDL, several statements) against a Product's database as the Product's own database role, in one transaction: if any statement fails nothing is kept. dry_run: true really runs the script and then rolls it back, so you learn whether it would succeed and, through a final SELECT or a RETURNING clause, what it would produce, without changing anything. Applying requires confirm: true because a bad UPDATE cannot be undone: take a database_backup first when the change is large. Row counts are not reported; end with a RETURNING clause or a SELECT count(*) when you need one. Transaction control (BEGIN, COMMIT, ROLLBACK, SAVEPOINT) is refused because the script already is one transaction. The first 500 characters of the SQL are kept in the audit trail, so keep secrets out of it; use secret_set for those.
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": {
"productId": "<productId>",
"databaseId": "<databaseId>",
"sql": "<sql>"
},
"name": "database_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | One or more statements separated by semicolons. If the last returns rows (SELECT, or anything with RETURNING) they come back in `rows`. | |
| confirm | No | Required for destructive operations. Without it a destructive call returns its plan and refuses, exactly as dry_run would. | |
| dry_run | No | Return the plan without applying it: the resources it would create, change or destroy, and an estimated monthly cost. Free, and has no side effects. Call this before any change you have not made before. | |
| productId | Yes | Product identifier, e.g. prd_7k2m9x4qw1nv8bz3ct6d. | |
| databaseId | Yes | ||
| idempotency_key | No | Replaying the same key returns the original result instead of acting twice. Strongly recommended for anything that creates a resource or spends money. |