Query database
db_queryExecute read-only SELECT queries on SQLite databases with safe parameter binding. Use positional or named placeholders to pass values without formatting them into SQL.
Instructions
Runs a single read-only SELECT query. Use params instead of formatting values into the sql string — a list for '?' positional placeholders, or a dict for ':name' named placeholders. The dict form is what makes for_each useful here: a for_each step with item_arg='params' over a list of row-dicts (e.g. from get_metadata) binds each dict directly — extra keys not referenced by the sql are simply ignored.
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": {
"db_path": "<db_path>",
"sql": "<sql>"
},
"name": "db_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| params | No | ||
| db_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||