Calculate average balance
calculate_average_balanceUse this when the user wants an average monthly balance calculator, a bank statement average balance, an average daily balance or proof of funds figures from their transactions. Put the statement rows into transactions (date, description, amount or credit/debit, running balance); convert pasted text or a screenshot into those fields, and use file or statement_text only as a fallback. Each calendar day is counted and the balance carries forward over days with no transactions. Returns the average per month and for the period, lowest and highest daily balance with dates, month-end balances, credits and debits per month, a running balance check that lists rows that differ, recurring salary-like credits, large one-off deposits, an Excel workbook and a 1-page PDF summary. Without an opening balance or a running balance it gives the relative change only. Does not connect to banks, read scans, or issue a bank certificate.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "calculate_average_balance"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Fallback: the statement file the user attached (CSV, Excel .xlsx or a text PDF), e.g. statement.pdf. Prefer transactions when the rows are in the chat. | |
| currency | No | Optional currency, e.g. "USD", "INR", "₱" or "EUR". Default: read from the amounts, else none shown. | |
| bank_name | No | Optional bank name for the PDF, e.g. "HDFC Bank". | |
| page_size | No | PDF page: "A4" (default) or "Letter". | |
| date_order | No | Optional order for dates like 03/09/2026: "dmy" (day first, India, UK, Philippines) or "mdy" (US). Default: decided from the dates; US when nothing decides it. | |
| period_end | No | Optional last day of the statement period, e.g. "2026-09-30". Days after the last transaction carry the last balance. Default: the last transaction date. | |
| period_start | No | Optional first day of the statement period, e.g. "2026-07-01". Days before the first transaction carry the opening balance. Default: the first transaction date. | |
| prepared_for | No | Optional purpose line for the PDF, e.g. "Schengen visa application" or "Home loan file". | |
| transactions | No | The statement rows as objects, oldest or newest first: [{"date":"2026-09-01","description":"Salary","amount":2500,"balance":3100}]. Convert a pasted statement or a screenshot into these fields. Copy the running balance column when there is one. Up to 5,000 rows. | |
| account_label | No | Optional account label for the PDF, e.g. "Savings ****1234". Long numbers are masked to the last 4 digits. | |
| balance_basis | No | Optional: "computed" (default, opening balance plus transactions) or "printed" (use the statement's running balance wherever it is printed). | |
| account_holder | No | Optional name printed on the PDF summary, any script, e.g. "Nguyễn Văn An". | |
| statement_text | No | Fallback only: statement rows pasted as text or CSV, one row per line, e.g. "2026-09-01, Salary, 2500.00, 3100.00". Prefer transactions. | |
| statement_year | No | Optional year for dates written without one, e.g. 2026. | |
| closing_balance | No | Optional balance at the end of the period, e.g. 3400.10. Used to check the rows, or to work out the opening balance when nothing else gives it. | |
| minimum_balance | No | Optional minimum average monthly balance the bank requires, e.g. 10000. Each month is checked against it. | |
| opening_balance | No | Balance at the start of the period (before the first transaction), e.g. 1250.00. Leave empty when the rows have a running balance: it is worked out from the first one. | |
| large_deposit_threshold | No | Optional size of a credit to flag as a large one-off deposit: a percent of the average balance ("50%", the default) or an amount (5000). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lowest | Yes | ||
| months | Yes | ||
| period | Yes | ||
| source | Yes | ||
| highest | Yes | ||
| absolute | Yes | ||
| currency | Yes | ||
| warnings | Yes | ||
| downloads | Yes | ||
| assumptions | Yes | ||
| months_shown | No | ||
| total_debits | Yes | ||
| transactions | Yes | ||
| closing_check | Yes | ||
| total_credits | Yes | ||
| large_deposits | Yes | ||
| opening_source | Yes | ||
| average_balance | Yes | ||
| closing_balance | Yes | ||
| minimum_balance | Yes | ||
| opening_balance | Yes | ||
| average_formatted | Yes | ||
| recurring_credits | Yes | ||
| large_deposit_rule | Yes | ||
| large_deposits_count | Yes | ||
| printed_basis_average | Yes | ||
| running_balance_check | Yes |