pg_query
Query a Postgres database with read-only SELECT statements. Use an optional connection ID to select the database connection.
Instructions
Run a read-only SELECT query against a configured Postgres connection.
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": "pg_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A SELECT statement. | |
| connectionId | No | Id of the postgres connection to use, from databases.config.yml. Optional when only one postgres connection is configured. |