postgres_query
Run custom SQL queries on PostgreSQL, supporting complex joins, aggregations, and parameterized inputs to prevent SQL injection. Handles operations beyond standard tools.
Instructions
Execute a custom SQL query against the PostgreSQL database. Use this for complex queries, joins, aggregations, and any SQL operation not covered by other tools.
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": {
"query": "<query>"
},
"name": "postgres_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | SQL query to execute. Use $1, $2, etc. for parameters to prevent SQL injection. | |
| parameters | No | Optional array of parameters for parameterized queries |