Bookkeeping

Add or change accounts

books_save_accounts · Changes data · Markdown

Adds accounts or changes them, matched by code: name, type, description, code, role or archived.

$0.001 a call

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

An example

Add an account for our Stripe balance, and one for the van we lease.

Your agent callsbooks_save_accounts$0.001 a call

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
{
  "accounts": [
    {
      "code": "1020",
      "name": "Stripe balance",
      "type": "asset",
      "description": "Card payments from the online shop, before they reach the bank."
    },
    {
      "code": "6750",
      "name": "Van lease",
      "type": "expense"
    }
  ]
}
What comes back
{
  "accounts": [
    {
      "account": "1020",
      "name": "Stripe balance",
      "type": "asset",
      "role": null,
      "archived": false,
      "balance": "0.00"
    },
    {
      "account": "6750",
      "name": "Van lease",
      "type": "expense",
      "role": null,
      "archived": false,
      "balance": "0.00"
    }
  ]
}

Use it when

The chart needs an account it lacks, or an account is renamed, renumbered or retired.

What it does

Add accounts or change them, matched by code: name, type (only while unused), description, a new code, archived (only with no balance and no role), a bank account's IBAN and BIC, and role. Roles are the accounts the books post to on their own: bank, cash, receivable, inventory, input_tax, sales_tax, payable, retained_earnings, opening_balances, sales, cost_of_sales, exchange, depreciation, accumulated_depreciation, asset_disposals, customer_credits, supplier_credits, expense_claims, import_vat. Giving a role moves it from the account that had it.

What comes back

accounts: each saved account with its code (account), name, type, role, archived and balance. Every change is kept in the books' history with what it was before. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
accountsRequiredarray of objects1 to 100 items.
accounts[].codeRequiredstringAn account code from the chart, e.g. "6600". 1 to 20 characters.
accounts[].namestringUp to 120 characters.
accounts[].typestringOne of: asset,liability,equity,income,expense.
accounts[].rolestringOne of: ,bank,cash,receivable,inventory,input_tax,sales_tax,payable,retained_earnings,opening_balances,sales,cost_of_sales,exchange,depreciation,accumulated_depreciation,asset_disposals,customer_credits,supplier_credits,expense_claims,import_vat.
accounts[].descriptionstringUp to 500 characters.
accounts[].archivedboolean
accounts[].new_codestringUp to 20 characters.
accounts[].ibanstringA bank account's IBAN, what bills paid in a batch are paid from; "" clears it. Up to 42 characters.
accounts[].bicstringUp to 11 characters.

The call

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

Terminal
curl -X POST https://api.conecto.chat/v1/tools/books_save_accounts \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"accounts":[{"code":"1020","name":"Stripe balance","type":"asset","description":"Card payments from the online shop, before they reach the bank."},{"code":"6750","name":"Van lease","type":"expense"}]}'

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).
invalid_input400A code, type or role is not valid, or a new account has no name and type.Fix what the message names; roles fit only some account types.
type_fixed409The account has entries or a role, so its type stays.Make a new account and move the balance with an entry.
code_taken409The new code is used already.Pick another code.
has_role409The account holds a role and cannot be archived.Give the role to another account first.
has_balance409The account still has a balance and cannot be archived.Move the balance to another account with books_record_entry first.
in_use409A tax or a payment method uses the account.Change the tax or payment_accounts first.
role_needed409The books need the role the account holds.Give that role to another account instead.
archived409The account or tax is archived.Use another one, or un-archive it with books_save_accounts.

Give this to your agent.

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