query
Execute read-only SQL against PostgreSQL with automatic policy validation, allowlist checks, and enforced row limits. Returns rows as JSON.
Instructions
Run a read-only SQL query against the database.
The query is validated against the security policy before execution: only allowlisted commands are accepted, denied keywords are rejected, and a LIMIT is appended automatically when the query has none.
Args: sql: SQL statement to execute (read-only).
Returns: Rows as a JSON array of objects, or an object with an "error" key.
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"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |