Query Rows
sqlite_queryRun read-only SELECT or WITH queries against a SQLite database, using paged results via limit/offset and named parameters for safe value binding.
Instructions
Run one read-only SQL statement (SELECT or WITH) against the SQLite database.
Results are paged at the SQL level: pass limit/offset rather than writing your own LIMIT when you need to page through many rows. Use named placeholders ($name) and params for values instead of interpolating them into the SQL.
Examples:
"How many books are there?" -> SELECT COUNT(*) AS books FROM books
"Books by author 3" -> sql: SELECT title FROM books WHERE author_id = $author_id, params: {"author_id": 3}
"Top 5 orders" -> sql: SELECT * FROM orders ORDER BY total DESC LIMIT 5
SQLite errors come back as tool errors naming the available tables or columns. This tool cannot modify data; use sqlite_execute or sqlite_insert_row for that.
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": "sqlite_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A single SELECT or WITH statement. Named placeholders look like $author_id. | |
| limit | No | Maximum rows to return | |
| offset | No | Number of rows to skip, for pagination | |
| params | No | Values for named placeholders, keyed without the "$": SELECT * FROM books WHERE author_id = $author_id -> {"author_id": 1} | |
| response_format | No | 'markdown' for readable text, 'json' for structured data | markdown |