run_sql
Run read-only SQL SELECT queries on a Grist document's SQLite database to analyze, aggregate, and join data across tables.
Instructions
Execute a read-only SQL query against the document's SQLite database. Useful for analysis, aggregation, and joins across tables.
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": "run_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL query (SELECT only) | |
| args | No | Positional query parameters | |
| doc_id | No | Document ID |