run_query
Query a Beancount ledger using BQL to retrieve financial data. Returns columns and rows, with truncation after 200 rows.
Instructions
Query the Beancount ledger using BQL.
Returns a dict with: columns — list of column name strings rows — list of rows, each a list of value strings truncated — true if the result was cut at 200 rows total_rows — full result count before any truncation error — present (instead of the above) if the BQL is invalid
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | A BQL query, e.g. 'SELECT account, sum(position) WHERE account ~ "Expenses" GROUP BY account'. Results are capped at 200 rows — add LIMIT for smaller sets. |