Read a database with SQL
query_databaseA read-only SQL query on one of the project's PostgreSQL databases; format short (default; a cut response says how to read the rest), detailed (wider limits) or csv (an export).
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": "query_database"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A read statement. | |
| limit | No | Row cap: short 200, detailed 400 (2,000 at most); csv 10,000 (50,000). | |
| trial | No | The key returned by the call that created the trial (deploy_app, upload_source or write_files: trial_key), passed again on each call. | |
| format | No | The response format. | short |
| project | No | The project. | |
| database | No | Name of the database (databases[].name); the first declared by default. | |
| max_bytes | No | Byte limit: short 40 KB, detailed and csv 200 KB. | |
| environment | No | Production or a preview. | production |
| timeout_seconds | No | Query timeout. |