Run SQL
sql_executeRun SQL on a branch as the project's database role. Read-only by default; pass read_only: false to write (database:write). DROP, TRUNCATE and DELETE/UPDATE without WHERE need confirm: true and the destructive scope (production:destructive on production). Use migrations_apply for schema changes. Scope: database:read.
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": {
"query": "<query>"
},
"name": "sql_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum rows to return (default 100) | |
| query | Yes | SQL, e.g. `select * from todos limit 10`. One statement when read-only; a script in one transaction when writing. | |
| branch | No | Branch id, e.g. `pr-42`. Default `production`. | |
| confirm | No | true only after the user approved the destructive operation | |
| read_only | No | Default true. Set false to write (needs database:write). | |
| project_id | No | Project id, e.g. `todo-app`. Default: the last one used, or your only one. | |
| organization_id | No | Organization id, e.g. `acme`. Default: the token's. |