Read from the workspace database
query_databaseRead workspace SQLite data with a single parameterized SELECT query. Runs read-only against the same database blocks use, so any statement that would change data is refused; use execute_sql for writes.
Instructions
Runs a READ against the workspace's own SQLite database — the same one blocks reach as db.query(...). The connection cannot write, so a statement that turns out to change something is refused rather than run; use execute_sql for that.
To see what exists: SELECT name FROM sqlite_master WHERE type = 'table' SELECT name, type, pk FROM pragma_table_info('tasks')
Note the second one: PRAGMA table_info(...) counts as a write on this connection, while the pragma_table_info(...) function is an ordinary read and answers the same question. Parameters are @name or :name — never concatenate a value into SQL.
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": {
"workspaceId": "<workspaceId>",
"sql": "<sql>"
},
"name": "query_database"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | One statement, e.g. "SELECT * FROM tasks ORDER BY created DESC LIMIT 20". | |
| params | No | Values for the @name placeholders, e.g. { "id": 7 }. | |
| workspaceId | Yes |