execute_sql
Run SQL queries against a configured PostgreSQL database and get results as CSV, with configurable row limits and read-only enforcement.
Instructions
Run SQL against a configured database and return the rows as CSV.
database is a name from list_databases. Whether writes are permitted is
fixed by configuration and cannot be changed per call: against a read-only
database, only read queries run.
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": {
"database": "<database>",
"query": "<query>"
},
"name": "execute_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| database | Yes | ||
| max_rows | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |