Run a read-only query
run_sqlExecute a single read-only SELECT or WITH query and return up to 50 rows; unsafe or unsupported SQL is refused, and database errors help fix invalid queries.
Instructions
Execute one read-only SELECT or WITH statement and return up to 50 rows. Anything else is refused: several statements, a write, a write inside a CTE, ATTACH, PRAGMA, SET, a row lock. When the database rejects the query you get its own error text back, which is usually enough to fix it.
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": "run_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||