query
Execute SQL commands against a PostgreSQL database, receiving results in table, CSV, or expanded format. Control execution with a timeout for safe exploration.
Instructions
Execute a SQL query against the PostgreSQL database. Returns the query results as text. Use LIMIT clauses on exploratory queries.
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 | The SQL query to execute | |
| format | No | Output format: table (default), csv, or expanded (vertical) | table |
| timeout | No | Query timeout in milliseconds (default: 30000) |