Bookkeeping

Book lines by the bank rules

books_apply_bank_rules · Changes data · Markdown

Books every new bank line a rule matches, each by the first rule that matches.

$0.02 per bank line booked

From your agent’s balance. A call that fails costs nothing.

An example

Book this week's statement by our rules and tell me what is left.

Your agent callsbooks_apply_bank_rules$0.02 per bank line booked

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
{}
What comes back
{
  "booked": 1,
  "left": 2,
  "lines": [
    {
      "line_id": 4102,
      "account": "1010",
      "date": "2026-10-06",
      "amount": "-89.25",
      "currency": "EUR",
      "description": "Packband Lager",
      "counterparty": "Würth",
      "reference": null,
      "status": "matched",
      "entries": [
        3
      ]
    }
  ],
  "skipped": []
}

Use it when

Right after books_import_bank, so only the lines no rule knows wait for a decision.

What it does

Book every new bank line a rule matches, oldest first, each by the first rule that matches (up to limit), on one bank account or all. Run it after books_import_bank. Lines no rule matches wait for books_match_bank_lines; a line the books can't take (a locked month) is listed under skipped with why. $0.02 per line booked, as matching it by hand.

What comes back

booked: how many lines were booked, left: how many new lines still wait, lines: each booked line with the entry it got, and skipped: lines a rule matched that the books could not take (a locked month), each with why. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
bank_accountstringOnly lines on this bank account (its code). Up to 20 characters.
limitinteger1 to 200. Default: 100.

The call

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

Terminal
curl -X POST https://api.conecto.chat/v1/tools/books_apply_bank_rules \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

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.
rule_broken409A rule books to an account that was archived or is gone.Change the rule with books_save_bank_rule.

Give this to your agent.

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