Run SQL
sql.executeRun SQL on a branch as the project's database role (never a superuser). Read-only by default. For writes pass read_only: false (database:write). DROP, TRUNCATE, ALTER ... DROP and DELETE/UPDATE without WHERE are destructive: they need confirm: true plus the destructive scope, and on production also production:destructive. Prefer 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. Read-only mode takes one statement; write mode takes a script run in one transaction. | |
| branch | No | Branch (environment) id. Optional: defaults to `production`. | |
| confirm | No | Must be true to run a destructive operation, after the user approved it | |
| read_only | No | Default true. Set false to write (needs database:write). | |
| project_id | No | Project id. Optional: defaults to the project created or used last in this session, or the only one. | |
| organization_id | No | Organization id. Optional: defaults to the token's organization, or the only one you belong to. |