Run read-only budget query
run_queryRun read-only SQL queries against Actual Budget data when built-in search, summary, or list tools cannot express the filter or join you need.
Instructions
Run a read-only SQL query against the budget data; the escape hatch when search_transactions, summarize_transactions, list_entities and list_budget_months do not fit (prefer them when they do). Form: SELECT [fields] FROM [table] WHERE [conditions] ORDER BY [field] DESC LIMIT [n]. Example: "SELECT id, date, amount, payee.name FROM transactions WHERE amount < 0 ORDER BY date DESC LIMIT 10". WHERE supports =, !=, >, >=, <, <=; IN (v1, v2); LIKE / NOT LIKE (case and accent-insensitive, % wildcard, e.g. imported_payee LIKE '%amazon%'); IS NULL / IS NOT NULL; boolean columns as true / false (cleared = false, category.hidden = true); conditions joined with AND. OR, REGEXP, NOT IN and parenthesised groups are not supported and return an error (a query is never silently run unfiltered). Writes, stacked statements and comments are refused. Transactions come back in split-inline mode: "is_parent = true" returns nothing, use "is_parent = false" to exclude split children. Joins use dot notation: payee.name, category.name, account.name (NOT payee_name). Amounts are in cents: $100.00 = 10000. Dates are quoted YYYY-MM-DD strings: date >= '2025-01-01'. Returns { result: { data: rows, dependencies } }; an empty result may carry a "hint" naming a category.name, payee.name or account.name value that matches no entity, with the query that lists the exact names. Tables: transactions (id, date, amount, notes, cleared, account, payee, category); accounts (id, name, closed, offbudget, sort_order, account_group_id); categories (id, name, group, is_income, hidden); payees (id, name, transfer_acct); category_groups (id, name, is_income, hidden; rows carry nested categories); also schedules, rules, notes, preferences, account_groups. Select the fields you need: a bare table name returns only { id }. AS aliases are 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": {
"query": "<query>"
},
"name": "run_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The read-only SQL query to run, for example SELECT id, name FROM accounts. |