db_query
Query discovered PostgreSQL, MySQL, or SQLite databases read-only. Obtain a connectionId with inspect_project, then run validated SELECT, WITH, or EXPLAIN statements; writes, functions, and unbounded executions are blocked.
Instructions
Read-only query of a discovered PostgreSQL, MySQL or SQLite database. First call inspect_project for a connectionId. Supports validated SELECT, read-only WITH and EXPLAIN SELECT, including metadata tables. Writes, arbitrary functions, multi-statements, comments and execution modifiers are rejected. Credentials remain inside the server. Rows and execution time are bounded.
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": {
"connectionId": "<connectionId>",
"query": "<query>"
},
"name": "db_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| maxRows | No | ||
| connectionId | Yes |