ledgerlens
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LEDGERLENS_DB | No | SQLite database path. | ~/.ledgerlens/ledgerlens.db |
| LEDGERLENS_LLM | No | `off` never calls the LLM from the server. | on |
| LEDGERLENS_RULES | No | Extra rules file, tried before the built-in rules. | |
| ANTHROPIC_API_KEY | No | Categorization fallback and the live eval. `ant auth login` profiles work too. | |
| LEDGERLENS_EVAL_MODEL | No | Agent model for the live eval. | claude-opus-5-5 |
| LEDGERLENS_IMPORT_DIR | No | If set, `import_statement` only reads files inside this folder. | |
| LEDGERLENS_JUDGE_MODEL | No | Judge model for free-text answers. | claude-sonnet-5-5 |
| LEDGERLENS_CATEGORIZER_MODEL | No | Model for the categorization fallback. | claude-haiku-5-5 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
LedgerLens answers questions about the user's bank statements stored locally.
Amounts are signed: negative = money spent, positive = money received. Tool outputs that say "spent"/"expenses" report spending as positive numbers.
For totals use spending_breakdown or monthly_summary; query_transactions returns one page of rows plus totals over ALL matching rows (see totals_by_currency).
Accounts can be in UAH, USD or EUR. Cross-account totals are converted with monthly reference rates; pass
currencyto choose the reporting currency.Months are written YYYY-MM. Use list_accounts first to see which dates have data.
Category corrections made with set_category stick across re-imports.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| import_statementA | Import a bank-statement CSV. Re-importing the same file adds no duplicates. |
| list_accountsA | List imported accounts with currency, row counts and covered date range. |
| query_transactionsB | Find transactions by date, account, category, merchant and amount. Totals in the result cover every matching row even when the page is truncated. |
| spending_breakdownB | Total spending (or income) grouped by category, merchant, month or account, converted to one reporting currency. |
| monthly_summaryB | Income, expenses, net, savings rate, category split and top merchants for a month, across all accounts, with the change versus the previous month. |
| categorize_transactionsA | Categorize transactions: user corrections first, then rules, then cached LLM answers, then the LLM fallback for unknown merchants. Never overrides corrections. |
| set_categoryA | Correct a category. Merchant-level corrections apply to past and future imports. |
| budget_statusA | Spending versus monthly budget limits, with status ok / warning (>=80%) / over and a month-end projection for months still in progress. |
| set_budgetB | Create, change or remove (limit 0) a monthly budget for a category. |
| detect_recurringA | Find subscriptions and other recurring charges, their cadence, monthly cost, next expected date and whether they still look active. |
| detect_anomaliesB | Flag unusually large purchases and months where a category spiked. |
| convert_currencyB | Convert between UAH, USD and EUR with the stored monthly reference rate (latest month when omitted). |
| set_fx_rateA | Store a manual monthly reference rate; it is never overwritten by imports. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| monthly_review | Review one month of spending and suggest where to cut. |
| subscription_audit | List recurring charges and flag ones worth cancelling. |
| budget_plan | Propose monthly budgets that reach a savings goal. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| overview | Accounts, data range and categorization coverage. |
| categories | The category taxonomy with descriptions. |
| budgets | Configured monthly budgets. |
| formats | Supported statement formats and the generic mapping keys. |
TDQS
Scored across 13 tools
Most tools have clearly distinct purposes: querying raw transactions, importing statements, categorizing, budgeting, recurring detection, anomalies, and FX rates are separable. The main overlap is between spending_breakdown and monthly_summary, which both aggregate spending by category/month, though their descriptions distinguish report scope and depth.
All names use consistent snake_case, and most are action-oriented verb_noun names such as query_transactions, set_budget, and convert_currency. A few report-style names like spending_breakdown, monthly_summary, and budget_status break the verb_noun pattern, but the overall convention remains readable and predictable.
The 13 tools are well-scoped for a personal-finance ledger server. Each tool covers a meaningful operation across imports, reporting, categorization, budgets, recurring charges, anomalies, and currency handling.
The surface covers the core finance lifecycle well: import, query, categorize, summarize, budget, detect recurring/anomalous activity, and handle currency. Minor gaps remain around editing or deleting individual transactions and managing accounts beyond listing imported ones.