Run one SQL statement
query_app_dbRun one SQL statement against a function app's own database, to read rows and to fix data. Not for schema: a table or a column belongs in the version's migrations/NNNN_name.sql, and a statement that changes the schema is refused. Owners and editors only. Answers rows and rowCount for a select, and changes with lastInsertRowid for a write.
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": {
"app_id": "<app_id>",
"sql": "<sql>"
},
"name": "query_app_db"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | One statement, with ? placeholders for every value that comes from somewhere else. A second statement in the same string is refused. | |
| app_id | Yes | The app id, as returned by search_apps or create_app. Starts with app_. | |
| params | No | The values for the ? placeholders, in order. Strings, numbers, booleans and null. |