Query database (read-only)
query_sqlRun ONE read-only SQL statement against the project's managed PostgreSQL database and return its rows — the same path as the dashboard DB console's read mode. Accepts a single statement starting with SELECT, WITH, EXPLAIN, SHOW, TABLE or VALUES; any ';' other than a trailing one is refused, even inside a string literal. Runs inside a PostgreSQL READ ONLY transaction, so a statement that tries to write fails in the database. Limits: 500 rows (truncated=true past that) and a 5-second statement timeout. Uses the project's own tenant credentials. Use execute_sql for INSERT, UPDATE, DELETE or schema changes.
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": {
"project_id": "<project_id>",
"sql": "<sql>"
},
"name": "query_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ONE read-only PostgreSQL statement starting with SELECT, WITH, EXPLAIN, SHOW, TABLE or VALUES. No ';' except a trailing one | |
| project_id | Yes | the project id (from list_projects) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| columns | Yes | ||
| truncated | No | ||
| project_id | Yes |