Bookkeeping

Import a bank statement

books_import_bank · Changes data · Markdown

Reads a bank statement from the file store (CSV, CAMT.053 or OFX) onto a bank account, skipping lines imported before.

Free

This tool costs nothing to call.

An example

Here's this month's bank statement as a CSV. Load it into the books.

Your agent callsbooks_import_bankFree

The example business is Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff. The reply is the one the tool really gives.

With these arguments
{
  "file_id": "6b2d9f41-7c3e-4a8b-9d0f-1e2a3b4c5d6e",
  "date_format": "DD.MM.YYYY",
  "decimal": ","
}
What comes back
{
  "account": "1010",
  "format": "csv",
  "statement_account": null,
  "added": 3,
  "already_imported": 0,
  "before_start_date": 0,
  "from": "2026-10-05",
  "to": "2026-10-08",
  "closing_balance": {
    "date": "2026-10-08",
    "amount": "14312.75"
  },
  "skipped_rows": 1,
  "next": "books_bank_lines lists the new lines with what each probably was."
}

Use it when

A new statement arrived; its lines then wait in books_bank_lines to be matched.

What it does

Read a bank statement from the file store onto a bank account (default the bank account): CSV as the bank exports it, CAMT.053 (.052, .054) or OFX/QFX. CSV columns are found by their headers in several languages; when they aren't, name them with columns. Lines imported before are skipped, so overlapping statements are fine. Each line then waits in books_bank_lines to be matched. Charged per line added.

What comes back

The account and the file's format, how many lines were added, already imported or before the start date, the dates covered, skipped rows, and next. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
file_idRequiredstringA file_id from the file store. Exactly 36 characters.
accountstringAn account code from the chart, e.g. "6600". 1 to 20 characters.
columnsobjectCSV header names, e.g. {"date": "Buchungstag", "amount": "Betrag", "description": "Verwendungszweck"}. money_in and money_out are for files with two amount columns; direction for a debit/credit marker column.
columns.datestringUp to 100 characters.
columns.amountstringUp to 100 characters.
columns.money_instringUp to 100 characters.
columns.money_outstringUp to 100 characters.
columns.descriptionstringUp to 100 characters.
columns.counterpartystringUp to 100 characters.
columns.referencestringUp to 100 characters.
columns.currencystringUp to 100 characters.
columns.balancestringUp to 100 characters.
columns.directionstringUp to 100 characters.
columns.bank_idstringUp to 100 characters.
date_formatstringOne of: YYYY-MM-DD,DD.MM.YYYY,DD.MM.YY,DD/MM/YYYY,MM/DD/YYYY,DD/MM/YY,MM/DD/YY,DD-MM-YYYY,MM-DD-YYYY,YYYY/MM/DD,YYYY.MM.DD,YYYYMMDD,DD MMM YYYY,DD-MMM-YYYY,MMM DD, YYYY,DD MMMM YYYY.
decimalstringThe CSV's decimal mark. One of: ,,.
currencystringThe statement's currency when the file doesn't say. Default the base currency. Matches ^[A-Za-z]{3}$.
max_linesintegerThe most lines this call may add (and hold the price for). 1 to 5,000. Default: 500.

The call

Over MCP, call books_import_bank on https://api.conecto.chat/mcp/books. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/books_import_bank \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"file_id":"6b2d9f41-7c3e-4a8b-9d0f-1e2a3b4c5d6e","date_format":"DD.MM.YYYY","decimal":","}'

When it refuses

A refused call costs nothing and says what to do next.

CodeWhenWhat to do
no_books409The business keeps no books yet.Set them up with books_setup (base currency, start date).
not_found404No account, tax, entry or file of the books has that code, name or id.Check the codes with books_list_accounts and the taxes with books_get.
archived409The account or tax is archived.Use another one, or un-archive it with books_save_accounts.
invalid_statement400The file is not a statement that can be read: an amount, a date or a currency is unreadable.Pass decimal "," for comma decimals, or check the file.
columns_needed400No header row with a date and an amount was found.Name the columns with columns, like {"date": "Buchungstag", "amount": "Betrag"}.
date_format_needed400The dates are in no known format, or could be several.Pass date_format, like "DD.MM.YYYY".
too_many_lines413The statement has more lines than max_lines.Pass a higher max_lines (up to 5,000).
too_large413The statement is over 10 MB.Split it by month.
invalid_input400The account is not a bank, card or cash account, or a setting is not valid.Import onto a bank account.

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md