run_query
Execute read-only SQL SELECT or WITH queries on local databases. Returns results as a formatted table with optional parameters and row limits.
Instructions
Execute a read-only SELECT query and return results as a formatted table. Only SELECT and WITH statements are permitted.
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": "run_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL SELECT statement to execute. Only read-only queries are permitted. | |
| params | No | Positional parameters for parameterized queries ($1/$2 in Postgres, ? in MySQL/SQLite) | |
| max_rows | No | Maximum rows to return (default 50, max 500) | |
| connection | No | Named connection to use. Defaults to the default connection. |