Accounting, Cenaly Books v2, postings & projects with AI
For chief accountants, CFOs, business owners and integrators: connect your Claude, ChatGPT/Codex or Google Antigravity client to your Cenaly account (connection guide) and work with Cenaly Books v2 double-entry ledgers, reconcile bank statements, inspect trial balances and tax worksheets, review project P&L by cost center and run month-end close audits in plain language.
The financial layer exposes 59 MCP tools across three domains:
accounting(44 tools: 33R0, 5R1, 6R2) — legal entity books (mgmt,statutory,tax,ifrs), chart of accounts, ledger postings, book bank (books_bank_*), cash orders, expense journal, manual adjustments, reconciliations, tax worksheets, regulatory forms and month-end close;management(7 tools: 6R0, 0R1, 1R2) — P&L and cash-flow articles, cost centers (ЦФО), management projects, budgets, plan-vs-actual variance and the book-to-book reconciliation bridge;bank(8 tools: 5R0, 1R1, 2R2) — operational “Counterparties → Bank” (bank_*) for linking bank payments to CRM counterparty cards and invoices.
In this article: entityId and book vs locationId, how bank_* differs from books_bank_*, entity, permissions & chart discovery, trial balance, postings & financial statements, reconciling the book bank, expenses, cash orders, adjustments & opening balances, sub-ledgers, acquiring, money, assets & stock, tax worksheets & forms, month-end close with confirmToken, management accounting, projects, budgets & book bridge.
1. First rule: legal entity (entityId) and book (book), not location (locationId)#
Unlike storefronts, warehouses or team task boards, accounting in Cenaly belongs to a legal entity (company / sole proprietor) rather than a storefront point:
- Every tool in
accounting(44 tools) andmanagement(7 tools) takes a requiredentityIdparameter (obtained frombooks_entitiesor the dynamic resourcecenaly://account/vertical-profile). - A single legal entity can maintain multiple parallel books (
bookfrombooks_entitiesorbooks_list):"mgmt"— management accounting book;"statutory"— national statutory accounting book governed by the entity's country pack;"tax"— tax accounting book;"ifrs"— IFRS book.
- Omitting
booktargets the legal entity's primary book.
2. The two bank contours: bank_* vs books_bank_*#
Cenaly intentionally separates operational CRM bank matching from double-entry accounting book reconciliation. An AI agent must never mix their identifiers or tools (also documented in-protocol at cenaly://guide/crm-vs-books):
| Dimension | “Accounting → Book Bank” (books_bank_*) |
“Counterparties → Bank” (bank_*) |
|---|---|---|
| Audience & purpose | For accountants: classifies statement rows by accounting class (class + attrs) or v2 decision to post double-entry ledger lines across the entity's books (books_postings, books_ledger_lines) |
For managers and sales ops: links incoming and outgoing bank payments to CRM counterparty cards (counterpartyId) and commercial invoices (docId) to update operational receivables and payables (crm_ledger_get, crm_payables_ledger) |
| Scope identifier | entityId (from books_entities) + optional book |
locationId or domain="CODE" (from list_locations) + accountKey (from bank_list_accounts) |
| Statement row identifier | itemId (starts with "bank:", from books_bank_lines) + month="YYYY-MM" |
opId + month="YYYY-MM" (from bank_search_operations) |
| Read / preview tools | books_bank_lines (include: ["classes", "rules", "balances", "imports"]), books_bank_v2_preview |
bank_list_accounts, bank_search_operations, bank_get_operation, bank_suggest_links, bank_import_status |
| Write / link tools | books_bank_v2_decide (R2 money, confirmMode: "token_optional" paired with books_bank_v2_preview), books_bank_decide (R2 money, confirmMode: "hint") |
bank_link_operations (R2 money, confirmMode: "hint"), bank_upload_statement (R1), bank_refresh (R2 integration — cenaly.ru only) |
How payment linking works in “Counterparties → Bank” (bank_*)#
- Call
bank_list_accountsfor the location (locationId) to discoveraccountKey, currency and covered months. - On
cenaly.ru, the account owner can pull fresh bank statements directly from Russian bank APIs (Tochka, T-Bank, Modulbank, Raiffeisen) viabank_refresh(action: "status" | "sync" | "resync" | "balances" | "events" | "test"). On any contour, statement files (1C, MT940, camt, OFX, CSV, XLSX) can be uploaded withbank_upload_statementand checked viabank_import_status. - Fetch automated match suggestions via
bank_suggest_links({ locationId, accountKey, months: ["2026-10"] }) and unlinked operations viabank_search_operations({ locationId, accountKey, from: "2026-10-01", to: "2026-10-31", link: "unlinked" }). - For unmatched rows, look up counterparties by tax ID or name via
crm_find_counterpartiesand open invoices viacrm_find_documents(awaitingPayment: true). - Present the proposed link table to the user and, after explicit confirmation, call
bank_link_operations(mode: "confirm_suggestions"or"manual"). Note: there is no unlink tool in MCP — erroneous links are reversed in the counterparty ledger in the admin app.
3. Discovering entities, permissions, chart of accounts and accountant tasks#
Start every accounting workflow with these 5 read calls (R0):
books_entitieswith{}— lists the account's legal entities (entityId, name, country, archived status). (If a staff user lacks permission to list all entities and receives403, readcenaly://account/vertical-profileor ask the user forentityId.)books_entitieswith{ entityId, period: "2026-10" }— returns the caller's accounting permissions (acct.read,acct.review,acct.post,acct.close,acct.close.override,acct.settings), the country pack ("ge","ru","tr", etc.) andbooks[].books_listwith{ entityId, period: "2026-10" }— inspects all books of the entity (id,kind, accounting basis, functional currency, chart ID, read-model revision).books_readinessandbooks_actionswith{ entityId, period: "2026-10" }— checks engine version (v1/v2), source coverage and the prioritized accountant to-do list (blocker,high,medium,low) withcanExecute.books_chartandbooks_policy_getwith{ entityId, book? }— loads postable leaf account codes, normal side (D/C), required analytic dimensions (dims[]) and accounting policy settings (include: ["document", "adjustment"]).
4. Trial balance, postings and financial statements#
| Tool | Risk | What it returns and key parameters |
|---|---|---|
books_ledger_lines |
R0 |
Books v2 ledger read model: view: "lines" (individual debit/credit lines filtered by year, from, to, account, counterparty, docId), view: "turnover" (trial balance turnovers per account), view: "accounts" (account balances). Paginate with cursor (from next). If 409 stale is returned, the read model was rebuilt — restart without cursor. |
books_postings |
R0 |
Reads postings, turnovers (view: "turnover") and chart balances (view: "accounts") across both Books v1 and v2. |
books_journal_events |
R0 |
Searches source journal events for period: "YYYY-MM" filtered by readiness, kind, q. |
books_journal_event |
R0 |
Full debit/credit entries generated by a single source document (docId). |
books_reports |
R0 |
Operational accounting reports: report: "trial-balance" (ОСВ), "general-ledger" (single account card), "pnl" (profit and loss) for period (YYYY-MM, YYYY-Qn, YYYY) sliced by location, costCenter, channel, itemCategory, counterparty. |
books_statements |
R0 |
Country-pack statutory financial statements (balance sheet, P&L, cash flow, equity) for year: "YYYY" or month: "YYYY-MM". Use view: "annual_package" for the full annual package, or explain: "<lineCode>" to trace any line down to accounts and postings. |
5. Reconciling book bank statements (books_bank_*)#
Step 1. Inspect statement lines and allowed classes#
Call books_bank_lines:
{
"entityId": "ent_main",
"period": "2026-10",
"status": "unclassified",
"include": ["classes", "rules", "balances", "imports"]
}
balances[]highlights statement-vs-book balance discrepancies peraccountKey.classes[]lists valid classification IDs (classes[].id) and their required attributes (classes[].required, such ascounterparty,taxId,employee,article).- Every statement row is addressed by
itemId(starting with"bank:").
Step 2A. Books v2 multi-book decision (books_bank_v2_preview → books_bank_v2_decide)#
In Books v2, a single statement decision generates synchronized postings across all affected books of the entity (mgmt, statutory, tax):
- Inspect line context (
R0): callbooks_bank_v2_previewwith{ entityId, month: "2026-10", itemId: "bank:…" }. - Dry-run postings and mint
confirmToken(R0): callbooks_bank_v2_previewwith the proposeddecision:The server validates accounts across all affected books and returns a postings preview,{ "entityId": "ent_main", "month": "2026-10", "itemId": "bank:2026-10-15:004", "decision": { "kind": "supplier_payment", "facts": { "counterparty": "Golden Mill Co.", "taxId": "7701234567" } }, "reason": "Flour supplier payment against invoice INV-GM-1034" }decideArgsand a single-useconfirmToken(mct1.*, valid 15 minutes). - Confirm and execute (
R2money,confirmMode: "token_optional"): show the multi-book debit/credit preview to the user, get explicit approval, and callbooks_bank_v2_decidewith{ ...decideArgs, confirmToken }. - Fallback to v1: if
books_bank_v2_previewreturnsgate: "decision_v2_disabled", usebooks_bank_decide(Step 2B).
Step 2B. Standard book bank classification (books_bank_decide)#
Show the proposed class and attrs to the user and, after explicit confirmation, call books_bank_decide (R2 money, confirmMode: "hint"):
- Classify a row:
{ entityId, action: "classify", month: "2026-10", itemId: "bank:…", class: "<classId>", attrs: { ... }, learn: { counterparty: true, text: true, amount: false } }. - Confirm or reject a suggested document match (
status: "suggested"):action: "confirm_match"or"reject_match"withspecIdandmatchId. - Other actions:
action: "clear"(reset classification),"upload"(upload statement file),"set_balance"(record statement closing balance),"recon"(re-run reconciliation).
6. Primary expenses, cash orders, manual adjustments and opening balances#
Cenaly Books enforces two-stage accounting safety: saving a draft (R1) never alters the general ledger until an R2 posting action is executed with human confirmation.
| Scenario | Tool chain | Safety rules and parameters |
|---|---|---|
| Primary business expenses & advance reports (rent, utilities, employee expenses) | books_expense_journal_list (R0) → books_expense_journal_save (R2 money, hint) |
Read: view: "journal" (docs: "missing" finds entries lacking supporting documents), "articles" or "advance_report" (from, to, employee). Write (after user confirmation): action: "add" | "update" | "remove" (baseVersion is required on "update" and "remove"). |
| Cash desk orders (ПКО / РКО) & cash book | books_cash_orders_list (R0) → books_cash_order_create (R2 money, hint) |
Read: view: "orders" | "order" | "cash_book". Always call books_cash_order_create with dryRun: true first (side: "in" | "out", leaf cashAccount and corrAccount from books_chart, amount, partyName, basis) to validate accounts and get the suggested cashFlowItem. Show the preview to the user, then call without dryRun (post: false for draft, post: true to post). Returns 409 cash_orders_unsupported if the chart has no cash sub-accounts. |
| Manual accounting adjustments (reclassifications, accruals, corrections) | books_adjustments (R0) → books_adjustment_save (R1) → books_adjustment_action (R2 money, hint) |
books_adjustment_save creates or edits a draft (kind: "judgement" | "reclassification" | "estimate" | "error" | "opening" | "autoReversal", effectiveDate, currency, reason, balanced lines: [{ account, dc: "D"|"C", amount }]). Nothing enters the ledger until books_adjustment_action (action: "review" | "approve" | "post" | "void", version). |
Bulk operations table import (CSV/XLSX or rows[]) |
books_operations_import_preview (R0) → books_operations_import_drafts (R1) |
Run books_operations_import_preview first to validate accounts and balances, then create adjustment drafts in batch via books_operations_import_drafts. |
| Opening balances & trial-balance import preview | books_opening_get (R0) → books_opening_import_preview (R0) |
books_opening_get (mode: "manual" | "import" | "both", formats: true) inspects opening balances; books_opening_import_preview (asOf: "YYYY-MM-DD", fileBase64) dry-runs an opening trial balance file without writing. |
7. Sub-ledgers, acquiring, money, fixed assets and book inventory#
Use these 8 read tools (R0) and 1 linking tool (R1) to reconcile analytical sub-ledgers with general ledger control accounts:
- Counterparty settlements in books:
books_settlements({ entityId, period: "2026-10", side: "receivables" | "payables" }) checks open documents, linked payments and the invariant “sub-ledger = general ledger control account”.books_settlement_link(R1,action: "check" | "link") re-links payments for a month. - Acquiring, delivery platforms & fiscal Z-reports:
books_reconciliationswithkind:"acquiring"— POS terminal ↔ acquirer report ↔ bank payout (with fee breakdown);"platforms"— delivery aggregators and marketplaces ↔ payouts;"fiscal_days"— fiscal Z-reports ↔ acquiring.
- Money matrix & 30-day payment calendar:
books_money_summary(from,to— expected vs received vs fees vs cash in transit) andbooks_payment_calendar(30-day cash balance forecast and cash-gap warnings). - Fixed & intangible assets:
books_assets_list({ entityId, period: "2026-10" }) — asset register, depreciation schedule and capitalizable purchase candidates. - Warehouse vs book inventory reconciliation:
books_stock_recon(view: "check" | "balances" | "journal" | "moves",asOf,location) — compares warehouse inventory valuation against accounting book inventory accounts. - IFRS & valuation registers:
books_registers_list(register: "leases" | "loans" | "valuation" | "calculations" | "subsequent_events").
8. Tax worksheets, regulatory forms and 404 capability_not_in_pack#
National tax worksheets (books_tax_worksheets, R0)#
books_tax_worksheets computes tax bases and verification schedules across 9 worksheet types (kind):
kind value |
What it computes |
|---|---|
"vat" |
VAT return calculation, purchase/sales books and input VAT credits |
"profit" / "profit_return" |
Corporate profit tax (including distributed profit tax regimes where applicable) |
"annual" |
Annual property and income tax worksheets |
"small_business" |
Small-business turnover journal and threshold tracking |
"usn" |
Simplified Tax System & KUDiR book (Russia country pack: usnView: "rows" | "coverage" | "queue" | "adjustments" | "settings") |
"withholding" |
Withholding tax on payouts |
"radar" |
Tax and registration threshold radar (VAT registration, special-regime caps) |
"taxpayer_check" |
Live public taxpayer registry lookup by taxId |
Regulatory forms (books_forms_list → books_form_get → books_form_draft)#
books_forms_list(R0,{ entityId, period }) — lists regulatory returns available in the entity's country pack.books_form_get(R0,{ entityId, formId, period, view: "live" }) — computes live form cell values from postings and flags validation issues; passexplain: "<cellId>"to trace a cell down to accounts and source documents.books_form_draft(R1,{ entityId, formId, period }) — saves an immutable draft snapshot of the form. Filing tax returns with government authorities (RS.ge, FNS, etc.) is a forbiddenR3operation and is never exposed in MCP.
9. Month-end close and two-step confirmToken (mct1.*)#
To audit and close an accounting period, use the built-in MCP prompt prompt="month_close_check" or run the following call chain:
Step 1. Four-step readiness audit (R0)#
books_completeness({ entityId, period: "2026-10" }) — source coverage across bank statements, POS/cash, expenses, payroll and warehouse.books_exceptions_list({ entityId, period: "2026-10", status: "active" }) — active accounting exceptions and close blockers.books_close_status({ entityId, period: "2026-10", full: true }) — period close state ("open","softClosed","hardClosed","locked"), readiness percentage, checklist items, period-end scheduled jobs (runJobs) andlastRun.books_settlements,books_stock_recon(view: "check") andbooks_reconciliations— verify sub-ledger and inventory invariants.
Step 2. Resolve exceptions (books_exception_resolve, R1)#
With the accountant's approval, resolve or accept exceptions:
books_exception_resolve with { entityId, id: "exc_…", action: "resolve" | "accept" | "snooze" | "assign", comment: "…" } (comment is mandatory when accepting a blocker).
Step 3. Execute close actions (books_close_action, R2 period-close)#
books_close_action enforces confirmation rules based on the action:
- Period-end jobs and soft close (
action: "runJobs" | "softClose" | "approve"withoutoverride: true,confirmMode: "hint"): show the checklist status to the user, get confirmation and callbooks_close_action("approve"requiresrunIdfrombooks_close_status). - Hard close, lock, reopen or blocker override (
action: "hardClose" | "lock" | "reopen"oroverride: true,confirmMode: "token_required"): the server requires a two-stepmct1.*confirmToken:- First call
books_close_actionwithdryRun: true:(Include a non-empty{ "entityId": "ent_main", "period": "2026-10", "action": "lock", "dryRun": true }commentwhenactionis"reopen"oroverride: true.) - The server verifies permissions (
acct.close/acct.close.override/ owner forreopen), hashes the live checklist state (sh) and returns the close preview along withconfirmToken(mct1.*, valid 15 minutes). - Present the preview to the user and, after explicit confirmation, repeat
books_close_actionwith the exact same arguments (withoutdryRun) plusconfirmToken:{ "entityId": "ent_main", "period": "2026-10", "action": "lock", "confirmToken": "mct1.eyJ2IjoxLCJqdGkiOiJtY18..." } - If any posting or checklist item changed after the preview, the server rejects the token with
409 confirm_state_changed— run a freshdryRun: truepreview.
- First call
10. Management accounting, projects, cost centers, budgets and the book bridge#
The management domain (7 tools, skill cenaly-mgmt-projects) operates on the legal entity's management book (entityId):
- Management structure & cost centers (
books_mgmt_structure,R0):- Call
books_mgmt_structurewith{ entityId, book?, month?: "2026-10" }to load the P&L article tree, cash-flow (ДДС) article tree, cost center (ЦФО) hierarchy and account bindings. Ifinitialized: falseis returned, ask the user to initialize a template in Accounting → Management Structure.
- Call
- Management projects (
books_mgmt_projects_list→books_mgmt_project_save):- Do not confuse with team tasks (
team_*) or CRM deals (crm_deals_*): a management project is a financial slice of the management book overfrom..to(YYYY-MM) defined by matching rulesmatch[](center,location,costCenter,counterparty). - List projects via
books_mgmt_projects_list({ entityId, includeArchived: true }) and record the directory revisionrev(passed asbaseRevon writes; concurrent edits return409 projects_stale). - Create or update a project (
op: "put",R1):{ entityId, op: "put", baseRev, project: { id, name, from: "2026-10", to: "2026-12", match: [{ center: "cc_launch", location: "loc_main" }], responsible, archived: false } }. - Delete a project (
op: "delete",R2delete,confirmMode: "token_required"): first callbooks_mgmt_project_savewith{ entityId, op: "delete", id: "<projectId>", baseRev, dryRun: true }, show the preview to the user and repeat with the returnedconfirmToken(mct1.*, valid 1 hour).
- Do not confuse with team tasks (
- Management P&L, cash flow, breakeven & cell drill-down (
books_mgmt_report,R0):- Entity-wide P&L and cash flow:
{ entityId, from: "2026-01", to: "2026-10", view: ["pnl", "cashflow"], location? }. - Single-project P&L:
{ entityId, from: "2026-10", to: "2026-10", view: ["pnl"], project: "<projectId>" }. - Breakeven analysis:
{ entityId, from: "2026-10", to: "2026-10", view: ["breakeven"], target?: 500000 }. - Drill down to source documents: pass
explain: true, article: "<articleId>", center?: "<costCenterId>", month: "2026-10"(plussnapfrom the previous response).
- Entity-wide P&L and cash flow:
- Budgets & plan-vs-actual variance (
books_budgets_list→books_budget_planfact,R0):books_budgets_list({ entityId }) lists P&L and cash-flow budgets and their version numbers.books_budget_planfact({ entityId, budgetId }) computes plan, actual and variance (amount and %) acrossarticle × cost center × month. Addexplain: true, month: "2026-10", article: "<articleId>", center?: "<costCenterId>"to list the exact documents behind any variance cell.
- Book-to-book reconciliation bridge (
books_bridge_get,R0):- When an entity keeps both a management book (
mgmt) and a statutory (statutory) or IFRS (ifrs) book,books_bridge_get({ entityId, from: "mgmt", to: "statutory", period: "2026-10" }) decomposes profit and equity differences intotarget = source + recognition + measurement + classification + fx + manual + unexplained. Passline: "<bridgeLineId>"to inspect the individual documents causing the difference.
- When an entity keeps both a management book (