Convert bank statement to Tally XML
convert_statement_to_tallyUse this when the user attaches a bank statement (text PDF, CSV or Excel from net banking) and wants it as Tally XML: "bank statement to tally xml", "import bank statement in tally prime", "excel to tally". Builds Payment, Receipt and Contra vouchers against the bank ledger, maps narrations to ledgers with keyword rules (unmatched rows go to a suspense ledger), checks each voucher balances and that opening + rows = closing, and returns the vouchers XML, a ledgers XML and an Excel review sheet. Does not read scans or photos (use generate_tally_vouchers with the rows you can read), does not post into Tally, and is not for GST returns or sales invoices.
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": {
"file": "<file>"
},
"name": "convert_statement_to_tally"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | The bank statement to convert: a text PDF, or the CSV or Excel (.xlsx) download from net banking, e.g. hdfc-april-2026.pdf. | |
| company | No | Optional Tally company name, e.g. Sharma Traders 2026-27. Leave empty to import into the company open in Tally. | |
| date_order | No | Order of numeric dates: DMY (default, 02/04/2026 = 2 April) or MDY. Detected from the file when a day is above 12. | |
| auto_contra | No | Book ATM withdrawals and cash deposits as Contra vouchers against the cash ledger. Default true. | |
| bank_ledger | No | Your bank ledger name exactly as in Tally, e.g. HDFC Bank A/c. Default: Bank Account. | |
| cash_ledger | No | Cash ledger for ATM withdrawals and cash deposits (booked as Contra), e.g. Cash. Default: Cash. | |
| ledger_rules | No | Narration keyword to ledger rules, first match wins, e.g. [{"match":"SALARY","ledger":"Salary Payable"},{"match":"GST","ledger":"GST Payable"}] or text "SALARY=Salary Payable; RENT=Rent". Rows that match no rule go to the suspense ledger. | |
| statement_year | No | Year for dates printed without one, e.g. 2026, or a financial year like "FY 2026-27" (April to December 2026, January to March 2027). | |
| closing_balance | No | Closing balance if the file has none, e.g. 98450.00. With the opening balance it proves no row is missing. | |
| opening_balance | No | Opening balance if the file has none, e.g. 125000.50 or "1,25,000.50 Cr". Used to check the total. | |
| suspense_ledger | No | Ledger for rows that match no rule, e.g. Suspense. Default: Suspense. | |
| bank_ledger_group | No | Group of the bank ledger in the ledgers file: Bank Accounts (default) or Bank OD A/c. | |
| voucher_type_names | No | Only if you renamed voucher types in Tally, e.g. {"payment":"Bank Payment","receipt":"Bank Receipt"}. Defaults: Payment, Receipt, Contra. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| totals | Yes | ||
| ledgers | Yes | ||
| preview | Yes | ||
| vouchers | Yes | ||
| warnings | Yes | ||
| downloads | Yes | ||
| xml_check | Yes | ||
| bank_ledger | Yes | ||
| import_steps | Yes | ||
| not_imported | Yes | ||
| unread_lines | Yes | ||
| ledgers_count | No | ||
| preview_count | No | ||
| reconciliation | Yes | ||
| suspense_count | Yes | ||
| financial_years | Yes | ||
| not_imported_count | Yes |