execute_read_query
Run read-only SELECT queries in a read-only transaction with safe bind parameters and an optional timeout to retrieve data without modifying the database.
Instructions
Run a read-only SELECT query (enforced as a read-only transaction).
Know the schema before you query: if the exact table and column names are not already in this conversation, call get_table_schema (or list_tables / find_columns) first instead of guessing — a wrong name costs a failed round-trip. Don't re-fetch a schema you already have.
ALWAYS pass user-supplied values via params with $1/$2/... placeholders in the
SQL (real driver bind parameters — no quoting/injection pitfalls), not by pasting
them into the SQL string. Optional timeout_ms cancels an overrunning query.
Rows arrive on the text channel only, inside the untrusted-data banner: this tool emits no structuredContent.
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>",
"sql": "<sql>"
},
"name": "execute_read_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| params | No | ||
| database | Yes | ||
| timeout_ms | No |