Run SQL
queryExecutes one read-only SQL statement and returns up to 100 rows, using placeholders and params for value binding.
Instructions
Runs one SQL statement in a read-only transaction and returns up to 100 rows. Use $1, $2 (Postgres) or ? (SQLite) with params for values. SQL uses table and column SQL names, not TypeScript keys.
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": "query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | One statement, such as a SELECT. | |
| limit | No | Rows to return, up to 100. | |
| params | No | Values for the placeholders in `sql`, in order: $1, $2 on Postgres, ? on SQLite. |