{"service":"Henda — Multi-Tenant Headless General Ledger, Subledger & Graph API","version":"2.0.0","base_url":"https://mcp.henda.ai","discovery_files":{"openapi_3_1_json":"https://mcp.henda.ai/openapi.json","graphql_sdl_schema":"https://mcp.henda.ai/graphql/schema.graphql","graphql_endpoint":"https://mcp.henda.ai/graphql","native_graph_batch_endpoint":"https://mcp.henda.ai/v1/batch","twenty_rest_batch_endpoint":"https://mcp.henda.ai/rest/batch/:objectName","mcp_streamable_http":"https://mcp.henda.ai/mcp","mcp_sse":"https://mcp.henda.ai/sse","llms_txt":"https://mcp.henda.ai/llms.txt","api_catalog_json":"https://mcp.henda.ai/v1/discovery","interactive_docs_html":"https://mcp.henda.ai/docs"},"strict_erp_invariants":["Chart of Accounts segment structure (1..10 segments, segment_num, segment_name, qualifier, exact_length, numeric_only) is defined explicitly via typed segments at Set of Books creation time (create_set_of_books / createGlLedgers).","Account and segment-value operations (create_account, upsert_accounts, upsert_segment_values, createGlAccounts, createGlSegmentValues) strictly enforce exact_length and numeric_only rules and support parent/child hierarchies (is_summary=true for parent rollup headers, parent_code for child accounts/segment values).","Double-entry equilibrium (Total Debits == Total Credits), Balancing Segment equilibrium, period status controls (OPEN vs CLOSED), and budget journal enforcement (require_budget_journals) are strictly enforced."],"modules":[{"id":"tenants-auth-security","name":"Multi-Tenant Onboarding, API Keys & Set of Books RBAC","description":"Tenant workspace registration and onboarding (provisioning tenant_id UUID, primary ORG_ADMIN user, initial Set of Books with 1..10 CoA segments, and initial API Key), Bearer API Key generation/revocation, Set of Books access matrix, and OAuth 2.0 MCP discovery.","rest_endpoints":[{"method":"GET","path":"/v1/tenants","description":"List registered tenant workspaces, their associated Sets of Books (sob_id), and active API key count"},{"method":"POST","path":"/v1/tenants/register","description":"Register & provision a new tenant workspace, primary admin user, optional initial Set of Books (1..10 segments), and scoped Bearer API Key"},{"method":"GET","path":"/v1/auth/api-keys","description":"List active & revoked Private API Keys (masked prefix, scopes, allowed_sob_ids)"},{"method":"POST","path":"/v1/auth/api-keys","description":"Generate a new Private API Key scoped to a tenant_id and allowed Sets of Books"},{"method":"DELETE","path":"/v1/auth/api-keys/:keyId","description":"Revoke a Private API Key immediately"},{"method":"GET","path":"/v1/auth/users","description":"List organization users and their Set of Books (SOB) query/post access matrix"},{"method":"POST","path":"/v1/auth/users","description":"Invite or update an organization user and assign accessible Sets of Books (sob_ids)"},{"method":"PATCH","path":"/v1/auth/users/:userId/sob-access","description":"Grant or revoke a user access to a specific Set of Books (sob_id)"},{"method":"POST","path":"/v1/auth/login","description":"Authenticate a user and cache selected Sets of Books for session / Henda Excel Add-in queries"}],"graphql_operations":{"queries":["glLedgers"],"mutations":["createGlLedgers(ledgers)"]},"batch_keys":["create_set_of_books"]},{"id":"general-ledger-coa","name":"General Ledger & Chart of Accounts (1..10 Segments)","description":"Multi-Book Sets of Books (SOB 1, 2, 3...), 1..10 Segment Key Flexfield Chart of Accounts (BALANCING, NATURAL_ACCOUNT, COST_CENTER, INTERCOMPANY, CUSTOM), and Parent/Child Accounts & Segment Values (is_summary, parent_code, account_sub_type, default_tax_rate_code, hidden_description).","rest_endpoints":[{"method":"GET","path":"/v1/accounts","description":"List CoA segment definitions (1..10) and Parent/Child Accounts & Segment Values for a Set of Books (sob_id, segment_num, account_category, account_sub_type, search)"},{"method":"POST","path":"/v1/accounts","description":"Create a single Account/Segment Value or batch-upsert an array of Accounts/Segment Values across segments 1..10"},{"method":"GET","path":"/v1/segment-values","description":"List CoA segment definitions (1..10) and Segment Values (alias for /v1/accounts)"},{"method":"POST","path":"/v1/segment-values","description":"Create or batch-upsert Segment Values across segments 1..10 (supports parent summary is_summary=true and child parent_code)"},{"method":"PATCH","path":"/v1/segment-values/:valueId","description":"Update/rename an Account or Segment Value (account_name, description, hidden_description, account_sub_type, default_tax_rate_code, parent_code, is_summary, allow_posting, is_active)"},{"method":"DELETE","path":"/v1/segment-values/:valueId","description":"Delete an unused Account or Segment Value (verifies zero posted journal lines)"},{"method":"POST","path":"/v1/calendars","description":"Create an Accounting Fiscal Calendar & Periods"},{"method":"POST","path":"/v1/coa-structures","description":"Create a Chart of Accounts Key Flexfield Structure (1..10 segments)"},{"method":"POST","path":"/v1/ledgers","description":"Create a Set of Books (General Ledger)"},{"method":"POST","path":"/v1/coa-structures/:coaStructureId/segment-values","description":"Create a Segment Value in a specific CoA Structure UUID"},{"method":"POST","path":"/v1/coa-structures/:coaStructureId/code-combinations","description":"Resolve or dynamically create a Code Combination (CCID)"}],"graphql_operations":{"queries":["glLedgers","glCoaSegments(sobId)","coaStructure(sobId)","glAccounts(sobId, segmentNum, accountCategory, accountSubType, search)","glSegmentValues(sobId, segmentNum, accountCategory, accountSubType, search)"],"mutations":["createGlLedgers(ledgers)","createGlAccounts(sobId, accounts)","updateGlAccounts(sobId, accounts)","createGlSegmentValues(sobId, segmentValues)","updateGlSegmentValues(sobId, segmentValues)","deleteGlAccounts(sobId, deleteCodes, segmentNum)"]},"batch_keys":["create_set_of_books","upsert_accounts","upsert_segment_values","delete_accounts"]},{"id":"journals-periods-statements","name":"Double-Entry Journals, Fiscal Periods & Financial Statements","description":"Atomic double-entry journal posting (single or vectorized batch), journal reversal, fiscal period OPEN/CLOSED control with automatic balance roll-forward, Year-End Close rollover, Trial Balance, P&L, Balance Sheet, and Account Activity Drilldown.","rest_endpoints":[{"method":"POST","path":"/v1/journals","description":"Post a balanced Double-Entry Journal Entry (or vectorized batch of journals)"},{"method":"POST","path":"/v1/journals/batch","description":"Vectorized high-speed batch journal posting engine"},{"method":"POST","path":"/v1/journals/:jeHeaderId/reverse","description":"Reverse a posted Journal Entry"},{"method":"GET","path":"/v1/ledgers/:ledgerId/periods","description":"List fiscal periods and statuses for a Set of Books"},{"method":"PATCH","path":"/v1/ledgers/:ledgerId/periods","description":"Open or Close a fiscal period (rolls forward Asset/Liability/Equity balances)"},{"method":"POST","path":"/v1/ledgers/:ledgerId/year-end-close","description":"Run Year-End Close rollover into Retained Earnings"},{"method":"GET","path":"/v1/ledgers/:ledgerId/trial-balance","description":"Get Trial Balance rollup (supports Actuals, Budgets, and Variance comparison)"},{"method":"GET","path":"/v1/ledgers/:ledgerId/financial-statements","description":"Get Financial Statement (PNL or BALANCE_SHEET)"},{"method":"GET","path":"/v1/ledgers/:ledgerId/drilldown","description":"Drill down into posted journal lines for an account or segment filter"}],"graphql_operations":{"queries":["glPeriods(sobId)","trialBalance(sobId, periodName, actualFlag, budgetName, compareBudgetName)","pnl(sobId, periodName)","balanceSheet(sobId, periodName)"],"mutations":["createGlJournals(sobId, actualFlag, budgetName, journals)","manageGlPeriods(sobId, periods)"]},"batch_keys":["post_journals","manage_periods"]},{"id":"budgets-forecasts","name":"Oracle GL Budgets & Forecasts","description":"Multi-version Budgets and Rolling Forecasts per Set of Books with configurable require_budget_journals control (direct balance injection vs formal budget journals) and Actual vs Budget variance reporting.","rest_endpoints":[{"method":"GET","path":"/v1/budgets","description":"List Budgets and Forecasts for a Set of Books (sob_id)"},{"method":"POST","path":"/v1/budgets","description":"Create a Budget or Forecast version (supports copy_from_budget_name)"},{"method":"PATCH","path":"/v1/budgets/:budgetId","description":"Update Budget status (OPEN, CURRENT, FROZEN) or require_budget_journals flag"},{"method":"POST","path":"/v1/budgets/inject","description":"Inject budget balances across periods or annual spread rules (when require_budget_journals=false)"},{"method":"POST","path":"/v1/budgets/journals","description":"Post balanced double-entry Budget Journals (actual_flag=\"B\")"}],"graphql_operations":{"queries":["glBudgets(sobId)"],"mutations":["createGlBudgets(sobId, budgets)","injectGlBudgetBalances(sobId, budgetName, mode, budgetEntries)"]},"batch_keys":["create_budget","create_budgets","inject_budget_balances"]},{"id":"accounts-receivable","name":"Accounts Receivable (AR) & AI Invoice Branding Studio","description":"Accounts Receivable subledger: AR GL Control Account onboarding setup, Tax Rates, Contacts (Customers & Suppliers), non-inventory Products & Services, multi-line Sales Invoices (Draft -> Approved -> Posted to GL -> Paid), Customer Payments, and AI-customizable HTML/PDF Invoice Layouts.","rest_endpoints":[{"method":"GET","path":"/v1/ar/setup","description":"Get AR subledger onboarding status and GL control account mapping"},{"method":"POST","path":"/v1/ar/setup","description":"Configure AR subledger GL control accounts (AR Control, Tax Liability, Default Sales Revenue)"},{"method":"GET","path":"/v1/ar/tax-rates","description":"List Tax Rates (GST on Income, GST Free, BAS Excluded, etc.)"},{"method":"POST","path":"/v1/ar/tax-rates","description":"Create or update an AR Tax Rate"},{"method":"DELETE","path":"/v1/ar/tax-rates/:taxRateId","description":"Delete or deactivate a custom Tax Rate"},{"method":"GET","path":"/v1/ar/contacts","description":"List Customer & Supplier Contacts with outstanding & overdue AR balances"},{"method":"POST","path":"/v1/ar/contacts","description":"Create or update a Customer or Supplier Contact"},{"method":"GET","path":"/v1/ar/products","description":"List non-inventory Products & Services"},{"method":"POST","path":"/v1/ar/products","description":"Create or update a non-inventory Product or Service"},{"method":"DELETE","path":"/v1/ar/products/:productId","description":"Deactivate, reactivate, or delete an unused Product/Service"},{"method":"GET","path":"/v1/ar/invoices","description":"List Sales Invoices with status, due amounts, and GL posting status"},{"method":"POST","path":"/v1/ar/invoices","description":"Create or update a Sales Invoice (supports auto_approve and auto_post_to_gl)"},{"method":"POST","path":"/v1/ar/invoices/approve","description":"Approve a Draft Sales Invoice and optionally post to GL"},{"method":"POST","path":"/v1/ar/invoices/post-to-gl","description":"Post approved Sales Invoice(s) to the General Ledger (respects OPEN/CLOSED period policies)"},{"method":"POST","path":"/v1/ar/invoices/payments","description":"Record a Customer Payment against an Invoice and post Cash Receipt journal to GL"},{"method":"POST","path":"/v1/ar/invoices/void","description":"Void an Invoice and automatically reverse its GL journal if posted"},{"method":"GET","path":"/v1/ar/invoice-layouts","description":"List AI-customizable Invoice Layouts & Branding Themes"},{"method":"POST","path":"/v1/ar/invoice-layouts","description":"Create or update an Invoice Layout (THEME_TOKENS or CUSTOM_HTML)"},{"method":"POST","path":"/v1/ar/invoice-layouts/render","description":"Render an Invoice into a standalone print-ready HTML document"},{"method":"GET","path":"/invoices/:sobId/:invoiceNumber","description":"Browser-accessible standalone HTML Invoice document view"}],"graphql_operations":{"queries":["arSetup(sobId)","arTaxRates(sobId)","arContacts(sobId, contactType, search)","arProducts(sobId, search)","arInvoices(sobId, status, glPostingStatus, search)","arInvoiceLayouts(sobId)"],"mutations":["configureArSetup(sobId, setup)","upsertArTaxRates(sobId, taxRates)","upsertArContacts(sobId, contacts)","upsertArProducts(sobId, products)","createArInvoices(sobId, invoices)","approveArInvoices(sobId, invoices)","postArInvoicesToGl(sobId, options)","recordArPayments(sobId, payments)","upsertArInvoiceLayouts(sobId, layouts)"]},"batch_keys":["configure_ar_setup","upsert_tax_rates","upsert_ar_contacts","upsert_ar_products","upsert_ar_invoices","approve_ar_invoices","post_ar_invoices_to_gl","record_ar_payments","upsert_ar_invoice_layouts"]},{"id":"cash-management","name":"Oracle Cash Management (CE) & AI Bank Reconciliation","description":"Bank, Credit Card, and Clearing account designation, multi-format Bank Statement Import Wizard (CSV, TSV, OFX/QFX, CAMT.053, JSON) with SHA-256 duplicate protection, and 4-tier AI reconciliation engine (Existing GL Journal Match -> Deterministic Rules -> MY_ACCOUNTANT.MD + hidden_description AI -> User Resolution).","rest_endpoints":[{"method":"GET","path":"/v1/bank-accounts","description":"List designated Bank, Credit Card, and Clearing accounts"},{"method":"POST","path":"/v1/bank-accounts","description":"Designate or update a Bank Account linked to a GL Cash/Card account"},{"method":"PATCH","path":"/v1/sob-bank-settings","description":"Update Set of Books bank reconciliation posting mode (AUTO_POST_HIGH_CONFIDENCE, REVIEW_ALL, AUTO_POST_ALL)"},{"method":"POST","path":"/v1/bank-reconciliation-rules","description":"Create or update a deterministic Bank Reconciliation Rule"},{"method":"POST","path":"/v1/bank-statements/preview","description":"Preview & auto-detect format/columns of a raw Bank Statement export"},{"method":"POST","path":"/v1/bank-statements/import","description":"Import Bank Statement lines and run 4-tier reconciliation"},{"method":"POST","path":"/v1/bank-statements/process","description":"Run or re-run the 4-tier Bank Reconciliation engine"},{"method":"POST","path":"/v1/bank-statements/resolve","description":"Approve AI suggestions, assign GL accounts, or ignore statement lines (can save learned rules)"},{"method":"GET","path":"/v1/bank-reconciliation","description":"Get Bank-to-GL Reconciliation Report and line-by-line status"}],"graphql_operations":{"queries":["bankAccounts(sobId)","bankReconciliation(sobId, periodName, bankAccountId)"],"mutations":["upsertBankAccounts(sobId, bankAccounts)","importBankStatement(sobId, statement)","processBankStatement(sobId, options)","resolveBankStatementLines(sobId, resolutions)"]},"batch_keys":["upsert_bank_account","import_bank_statement","process_bank_statement","resolve_bank_statement_lines"]},{"id":"excel-gl-wand-ai-brain","name":"Henda Excel Add-in, AI Accountant Brain & Multi-Book Security","description":"Live Henda Excel Add-in formula endpoints (=Get_Balance, =Segment_Description, Expand, Drilldown), server-side .xlsx report generator, per-Set-of-Books AI Accountant Brain (MY_ACCOUNTANT.MD), and Multi-User Set of Books RBAC.","rest_endpoints":[{"method":"GET","path":"/v1/accountant-brain","description":"Get compiled MY_ACCOUNTANT.MD AI Accountant Brain & CoA intended usage rules"},{"method":"PATCH","path":"/v1/accountant-brain","description":"Update MY_ACCOUNTANT.MD policies, append learned rules, or update account hidden_description rules"},{"method":"POST","path":"/v1/reports/excel","description":"Generate a multi-sheet .xlsx Financial Workbook (Trial Balance, P&L, Balance Sheet, Henda Excel Add-in Formulas)"},{"method":"GET","path":"/v1/reports/download/:filename","description":"Download a generated .xlsx report workbook"},{"method":"GET","path":"/gl-wand","description":"Open the Interactive Henda Excel Add-in Web Workbench"},{"method":"POST","path":"/v1/gl-wand/get-balance","description":"Evaluate Henda Excel Add-in Get_Balance() formula with ranges, wildcards, and parent rollups across 1..10 segments"},{"method":"POST","path":"/v1/gl-wand/drilldown","description":"Drill down from a Henda Excel Add-in balance cell into underlying journal lines & source invoice links"},{"method":"GET","path":"/v1/auth/users","description":"List users and their Set of Books (SOB) access matrix"}],"graphql_operations":{"queries":["accountantBrain(sobId)","glWandBatchBalances(balanceQueries)","glWandBatchDescriptions(descriptionQueries)"],"mutations":["executeGraphBatch(batch)"]},"batch_keys":["update_accountant_brain"]}],"graph_api":{"graphql_endpoint":"https://mcp.henda.ai/graphql","graphql_sdl_url":"https://mcp.henda.ai/graphql/schema.graphql","native_batch_endpoint":"https://mcp.henda.ai/v1/batch","twenty_rest_batch_endpoint":"https://mcp.henda.ai/rest/batch/:objectName","supported_twenty_batch_objects":["glLedgers","glAccounts","glSegmentValues","glJournals","glBudgets","glBudgetBalances","glBudgetJournals","arContacts","arProducts","arTaxRates","arInvoices","arInvoiceLayouts","ceBankAccounts"]},"mcp_tools_count":63,"mcp_tools":[{"name":"get_sets_of_books_status","title":"Get Sets of Books Status (v2.0.0)","description":"Get comprehensive status of all Sets of Books (SOB 1, SOB 2, SOB 3...), including functional currency, company description, MY_ACCOUNTANT.MD rules, open/closed accounting periods, posted journal counts, Trial Balance equilibrium status, and active user session access.","rest_action_url":"https://mcp.henda.ai/v1/gpt/get_sets_of_books_status","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Optional Set of Books ID filter (1, 2, 3...)"}}}},{"name":"get_accountant_brain","title":"Get AI Accountant Brain (MY_ACCOUNTANT.MD) (v2.0.0)","description":"Get the complete AI Accountant Brain (`MY_ACCOUNTANT.MD`) for a Set of Books (`sob_id`), including what the company/Set of Books is about (`description`), standing accounting policies & learned user preferences (`my_accountant_md`), open periods, every Chart of Accounts segment & account with its intended usage (`hidden_description`), and the full compiled `MY_ACCOUNTANT.MD` context document.","rest_action_url":"https://mcp.henda.ai/v1/gpt/get_accountant_brain","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (1, 2, 3, 4...). Defaults to 1."}}}},{"name":"update_accountant_brain","title":"Update AI Accountant Brain (MY_ACCOUNTANT.MD) (v2.0.0)","description":"Update the AI Accountant Brain (`MY_ACCOUNTANT.MD`) for a Set of Books (`sob_id`): update the Set of Books company `description` (what the company is about), replace `my_accountant_md`, append a new learned user preference/feedback rule (`append_learned_rule`), or update intended account usage descriptions (`account_rules`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/update_accountant_brain","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (1, 2, 3, 4...). Defaults to 1."},"description":{"type":"string","description":"Updated description of what the Set of Books / company is about (industry, business model, tax/GST regime, bank accounts)"},"my_accountant_md":{"type":"string","description":"Optional full replacement content for the MY_ACCOUNTANT.MD accounting policies & learned preferences document"},"append_learned_rule":{"type":"string","description":"Append a new learned user preference or accounting rule to the Learned User Preferences & Feedback Log in MY_ACCOUNTANT.MD without overwriting existing policies"},"rule_author":{"type":"string","description":"Optional label for who gave the feedback, e.g. \"CFO Feedback\" or \"User Instruction\""},"account_rules":{"type":"array","description":"Optional batch of per-account intended usage rules (hidden_description) to update simultaneously","items":{"type":"object","properties":{"code":{"type":"string","description":"Account or segment code, e.g. \"4010\", \"5100\", \"100\""},"segment_num":{"type":"number","description":"Segment number (default 2 = Natural Account)"},"hidden_description":{"type":"string","description":"Intended usage / AI allocation rule for this account"},"description":{"type":"string","description":"Optional updated standard account description"}},"required":["code"]}}}}},{"name":"create_set_of_books","title":"Create Set of Books (1 to 10 Segments Supported) (v2.0.0)","description":"Create a new Set of Books (General Ledger) with its own SOB_ID, Functional Currency (e.g. AUD, USD, EUR, SGD), company description, MY_ACCOUNTANT.MD rules, and its own isolated Chart of Accounts (coa_structure_id) supporting 1 to 10 segments (e.g. 3 segments: Company-Account-Cost Center, or 6 segments: Company-Natural Account-Cost Centre-Product-Channel-Intercompany, up to 10 segments). Pass `segments` to define 1..10 custom segments and their default values, and optionally pass `accounts` to seed right away.","rest_action_url":"https://mcp.henda.ai/v1/gpt/create_set_of_books","inputSchema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the new Set of Books, e.g. \"Venco Projects Australia (AUD)\""},"functional_currency":{"type":"string","description":"ISO 4217 3-letter currency code, e.g. AUD, USD, NZD, GBP, EUR, SGD"},"description":{"type":"string","description":"Description of what the Set of Books / company is about for the AI Accountant"},"my_accountant_md":{"type":"string","description":"Initial MY_ACCOUNTANT.MD accounting policies & learned preferences Markdown document for this Set of Books"},"initial_open_period_name":{"type":"string","description":"Initial open fiscal period, default \"OCT-26\""},"sob_id":{"type":"number","description":"Optional explicit Set of Books numeric ID"},"company_code":{"type":"string","description":"Optional 2-digit Balancing Segment company code, e.g. \"04\""},"company_name":{"type":"string","description":"Optional legal entity name, e.g. \"Venco Projects Australia Pty Ltd\""},"isolated_coa":{"type":"boolean","description":"Whether this Set of Books has its own separate Chart of Accounts structure (default true)"},"copy_template_accounts":{"type":"boolean","description":"Whether to copy all template accounts from SOB 1 (true) or only seed parent rollup headers and core control accounts (false)"},"segments":{"type":"array","description":"Optional Chart of Accounts segment definitions (supports 1 to 10 segments, e.g. Company, Account, Cost Centre, Product, Channel, Intercompany, Project, Geography, etc.). Defaults to 3 segments (Company[2]-Account[4]-Cost Center[3]) if omitted.","items":{"type":"object","properties":{"segment_num":{"type":"number","description":"Segment position 1..10"},"segment_name":{"type":"string","description":"Segment display name (e.g. \"Company\", \"Account\", \"Cost Centre\", \"Product\", \"Channel\", \"Intercompany\", \"Geography\")"},"qualifier":{"type":"string","description":"BALANCING, NATURAL_ACCOUNT, COST_CENTER, INTERCOMPANY, or CUSTOM"},"exact_length":{"type":"number","description":"Fixed character length of codes in this segment (e.g. 2, 3, 4)"},"numeric_only":{"type":"boolean","description":"True if codes must be digits only, false if alphanumeric codes (e.g. \"P01\", \"DIR\") are allowed"},"default_values":{"type":"array","description":"Optional initial segment values to seed for this segment","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"account_category":{"type":"string"},"parent_code":{"type":"string"},"is_summary":{"type":"boolean"},"allow_posting":{"type":"boolean"}},"required":["code"]}}},"required":["segment_name"]}},"accounts":{"type":"array","description":"Optional list of custom Natural Accounts or Segment Values (across any segment_num 1..10) to create in this Set of Books' Chart of Accounts","items":{"type":"object","properties":{"code":{"type":"string","description":"Natural Account code (e.g. \"4110\") or segment value code"},"account_name":{"type":"string","description":"Short display name of the account or segment value"},"description":{"type":"string","description":"Detailed accounting description"},"hidden_description":{"type":"string","description":"Optional AI / AR allocation rules"},"account_category":{"type":"string","description":"ASSET, LIABILITY, OWNERS_EQUITY, REVENUE, or EXPENSE"},"segment_num":{"type":"number","description":"Segment number 1..10 (e.g. 1=Company, 2=Natural Account (default), 3=Cost Center, 4..10=Custom segments like Product, Channel, Intercompany)"},"parent_code":{"type":"string","description":"Optional parent summary code (e.g. \"4000\", \"5000\", \"6000\")"}},"required":["code"]}}},"required":["name","functional_currency"]}},{"name":"list_accounts","title":"List Chart of Accounts & Segments (1..10) (v2.0.0)","description":"List Chart of Accounts segment definitions (1..10) and Natural Accounts / Flexfield Segment Values for a Set of Books (sob_id), including code, account_name, description, and hidden_description (AI/AR automatic journal allocation rules).","rest_action_url":"https://mcp.henda.ai/v1/gpt/list_accounts","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID to list accounts for (1, 2, 3, 4...). Defaults to 1."},"segment_num":{"type":"number","description":"Filter by segment number 1..10 (e.g. 1=Company, 2=Natural Account, 3=Cost Center, 4..10=Custom segments)"},"account_category":{"type":"string","description":"Optional filter by account classification: ASSET, LIABILITY, OWNERS_EQUITY, REVENUE, EXPENSE"},"search":{"type":"string","description":"Optional keyword search across code, account_name, description, and hidden_description"}}}},{"name":"batch_execute","title":"Execute High-Speed Graph / Batch Operations (v2.0.0)","description":"High-Speed Graph & Bulk Operations Engine (TwentyCRM-style batch mutations + compound queries in a single sub-10ms transaction). PREFERRED whenever creating a multi-segment Set of Books (1 to 10 segments), creating/renaming/deleting multiple accounts or segment values (across segments 1..10), opening/closing multiple periods, or posting multiple journals at once. Can also return requested reports (status, accounts, trial_balance, pnl, balance_sheet, periods) in the same round-trip.","rest_action_url":"https://mcp.henda.ai/v1/gpt/batch_execute","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Target Set of Books ID (1, 2, 3, 4...). Ignored if create_set_of_books is provided (uses the newly created Set of Books)."},"create_set_of_books":{"type":"object","description":"Optional Set of Books to create first before running the batch operations (supports 1 to 10 Chart of Accounts segments via `segments`)","properties":{"name":{"type":"string","description":"Name of the new Set of Books"},"functional_currency":{"type":"string","description":"ISO 4217 currency code e.g. AUD, USD, NZD, GBP"},"initial_open_period_name":{"type":"string","description":"Initial open period, default \"OCT-26\""},"company_code":{"type":"string","description":"2-digit company code e.g. \"04\""},"company_name":{"type":"string","description":"Legal entity name"},"isolated_coa":{"type":"boolean","description":"Create isolated Chart of Accounts (default true)"},"copy_template_accounts":{"type":"boolean","description":"Copy template accounts (true) or only seed parent rollup headers + control accounts (false)"},"segments":{"type":"array","description":"Optional Chart of Accounts segment definitions (supports 1 to 10 segments, e.g. Company, Account, Cost Centre, Product, Channel, Intercompany)","items":{"type":"object","properties":{"segment_num":{"type":"number","description":"Segment position 1..10"},"segment_name":{"type":"string","description":"Segment display name"},"qualifier":{"type":"string","description":"BALANCING, NATURAL_ACCOUNT, COST_CENTER, INTERCOMPANY, or CUSTOM"},"exact_length":{"type":"number","description":"Fixed character length of codes in this segment (e.g. 2, 3, 4)"},"numeric_only":{"type":"boolean","description":"True for numeric-only codes, false for alphanumeric"},"default_values":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"account_category":{"type":"string"},"parent_code":{"type":"string"},"is_summary":{"type":"boolean"},"allow_posting":{"type":"boolean"}},"required":["code"]}}},"required":["segment_name"]}}},"required":["name","functional_currency"]},"upsert_accounts":{"type":"array","description":"Batch of accounts / segment values (across any segment_num 1..10, including summary parent accounts with is_summary=true and child accounts with parent_code) to create or rename/update in one atomic SQL transaction","items":{"type":"object","properties":{"code":{"type":"string","description":"Account or segment code matching the segment exact_length"},"account_name":{"type":"string","description":"Short display name of the account or segment value"},"description":{"type":"string","description":"Full accounting description"},"hidden_description":{"type":"string","description":"AI / AR automatic journal allocation rules"},"account_category":{"type":"string","description":"ASSET, LIABILITY, OWNERS_EQUITY, REVENUE, or EXPENSE"},"account_sub_type":{"type":"string","description":"STANDARD, BANK_CASH, CREDIT_CARD, BANK_CLEARING, AR_CONTROL, or AP_CONTROL"},"default_tax_rate_code":{"type":"string","description":"Optional default tax rate code (e.g. GST_ON_INCOME, GST_ON_EXPENSES, BAS_EXCLUDED)"},"segment_num":{"type":"number","description":"Segment number 1..10 (1=Company, 2=Natural Account (default), 3=Cost Center, 4..10=Custom dimensions)"},"parent_code":{"type":"string","description":"Optional parent summary code (e.g. \"1000\", \"4000\", \"5000\", \"6000\")"},"is_summary":{"type":"boolean","description":"True if parent rollup summary account/segment"},"allow_posting":{"type":"boolean","description":"Whether journals can post to this account"},"is_active":{"type":"boolean","description":"Whether this account/segment value is active"}},"required":["code"]}},"upsert_segment_values":{"type":"array","description":"Alias for upsert_accounts: batch of segment values across any segment 1..10 (Company, Natural Account, Cost Center, Product, Channel, etc., supporting parent/child hierarchy via is_summary and parent_code)","items":{"type":"object","properties":{"code":{"type":"string","description":"Segment value code matching segment exact_length"},"account_name":{"type":"string","description":"Short display name"},"description":{"type":"string","description":"Full description"},"hidden_description":{"type":"string","description":"AI / AR allocation rules"},"account_category":{"type":"string","description":"Required for NATURAL_ACCOUNT: ASSET, LIABILITY, OWNERS_EQUITY, REVENUE, EXPENSE"},"account_sub_type":{"type":"string","description":"STANDARD, BANK_CASH, CREDIT_CARD, BANK_CLEARING, AR_CONTROL, or AP_CONTROL"},"default_tax_rate_code":{"type":"string"},"segment_num":{"type":"number","description":"Segment number 1..10"},"parent_code":{"type":"string","description":"Optional parent summary code"},"is_summary":{"type":"boolean","description":"True if parent summary value"},"allow_posting":{"type":"boolean"},"is_active":{"type":"boolean"}},"required":["code"]}},"delete_accounts":{"type":"array","description":"Batch of account codes (e.g. [\"4444\", \"6200\"]) to delete from this Set of Books","items":{"type":"string"}},"manage_periods":{"type":"array","description":"Batch of fiscal periods to OPEN or CLOSE","items":{"type":"object","properties":{"period_name":{"type":"string","description":"e.g. \"SEP-26\", \"OCT-26\", \"NOV-26\""},"target_status":{"type":"string","description":"OPEN or CLOSED"}},"required":["period_name","target_status"]}},"post_journals":{"type":"array","description":"Batch of balanced double-entry journals (Actual or Budget) to post in one call","items":{"type":"object","properties":{"name":{"type":"string","description":"Journal header title"},"description":{"type":"string","description":"Journal narrative"},"effective_date":{"type":"string","description":"YYYY-MM-DD (default \"2026-10-28\")"},"period_name":{"type":"string","description":"Optional period name e.g. \"OCT-26\""},"je_category":{"type":"string","description":"GENERAL, SALES, EXPENSES, TREASURY, PAYROLL, BUDGET"},"actual_flag":{"type":"string","description":"A = Actuals (default), B = Budget journal"},"budget_name":{"type":"string","description":"Budget version name when actual_flag=\"B\""},"lines":{"type":"array","items":{"type":"object","properties":{"account_code":{"type":"string","description":"e.g. \"04-4110-100\" or \"4110\""},"debit":{"type":"number","description":"Debit in major units"},"credit":{"type":"number","description":"Credit in major units"},"description":{"type":"string","description":"Line description"}},"required":["account_code"]}}},"required":["name","lines"]}},"create_budget":{"type":"object","description":"Optional Oracle GL Budget or Forecast version to create for this Set of Books","properties":{"budget_name":{"type":"string","description":"Unique Budget or Forecast version name, e.g. \"FY27_REVISED\""},"description":{"type":"string"},"budget_type":{"type":"string","description":"BUDGET or FORECAST"},"status":{"type":"string","description":"OPEN, CURRENT, or FROZEN"},"require_budget_journals":{"type":"boolean","description":"If false, allows direct gl_balances injection; if true, requires formal budget journals"},"copy_from_budget_name":{"type":"string","description":"Optional budget version name to copy balances from"}},"required":["budget_name"]},"create_budgets":{"type":"array","description":"Optional batch of Budget or Forecast versions to create","items":{"type":"object","properties":{"budget_name":{"type":"string"},"description":{"type":"string"},"budget_type":{"type":"string"},"status":{"type":"string"},"require_budget_journals":{"type":"boolean"},"copy_from_budget_name":{"type":"string"}},"required":["budget_name"]}},"inject_budget_balances":{"type":"object","description":"Direct top-level budget balance injection into gl_balances (when require_budget_journals=false)","properties":{"budget_name":{"type":"string","description":"Target budget version name, e.g. \"FY27_BUDGET\""},"mode":{"type":"string","description":"REPLACE (default) or ADD"},"entries":{"type":"array","items":{"type":"object","properties":{"account_code":{"type":"string"},"period_name":{"type":"string"},"amount":{"type":"number"},"debit":{"type":"number"},"credit":{"type":"number"},"periods":{"type":"object"},"annual_amount":{"type":"number"},"spread_rule":{"type":"string"}},"required":["account_code"]}}},"required":["budget_name","entries"]},"return_queries":{"type":"array","description":"Optional read queries to include in the response (executed in parallel): \"status\", \"accounts\", \"trial_balance\", \"pnl\", \"balance_sheet\", \"periods\", \"budgets\", \"bank_accounts\", \"bank_recon_rules\", \"bank_statement_headers\", \"bank_statement_lines\", \"ar_settings\", \"tax_rates\", \"ar_contacts\", \"ar_products\", \"ar_invoices\", \"ar_invoice_layouts\", \"gl_wand_snapshot\", \"drilldown\", \"users\", \"tenants\", \"discovery\"","items":{"type":"string"}},"balance_queries":{"type":"array","description":"Optional batch of Henda Excel Add-in =Get_Balance(...) queries to evaluate in-memory against a single preloaded snapshot","items":{"type":"object"}},"description_queries":{"type":"array","description":"Optional batch of Henda Excel Add-in =Get_Account_Description(sob_id, segment_num, code) lookups to evaluate in-memory","items":{"type":"object","properties":{"sob_id":{"type":["number","string"]},"segment_num":{"type":"number"},"code":{"type":"string"}},"required":["code"]}},"reverse_journals":{"type":"array","description":"Optional batch of posted Journal Entries to reverse in one call","items":{"type":"object","properties":{"je_header_id":{"type":"string"},"reversal_effective_date":{"type":"string"}},"required":["je_header_id"]}},"run_year_end_close":{"type":"object","description":"Optional Year-End Close operation to execute within the batch","properties":{"closing_period_name":{"type":"string"},"retained_earnings_account_code":{"type":"string"},"close_period_after":{"type":"boolean"}}},"period_name":{"type":"string","description":"Period for return_queries (default \"OCT-26\")"},"actual_flag":{"type":"string","description":"A = Actuals (default), B = Budget for return_queries"},"budget_name":{"type":"string","description":"Budget version name when actual_flag=\"B\" in return_queries"},"compare_budget_name":{"type":"string","description":"Optional budget version name to compute Actual vs Budget variance in return_queries"},"drilldown_account_code":{"type":"string","description":"Account code when \"drilldown\" is included in return_queries"}}}},{"name":"create_account","title":"Create Account or Batch of Accounts / Segment Values (Segments 1..10) (v2.0.0)","description":"Create a single Natural Account or Segment Value (across any segment_num 1..10) OR pass `accounts` (array) to batch-create/upsert many accounts/segment values at once in a single fast SQL transaction for a Set of Books (`sob_id`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/create_account","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID whose Chart of Accounts this account belongs to (default 1)"},"code":{"type":"string","description":"Single account or segment code matching the segment exact_length"},"account_name":{"type":"string","description":"Short display name of the account or segment value"},"description":{"type":"string","description":"Detailed accounting description"},"hidden_description":{"type":"string","description":"Hidden AI / AR allocation rules used to automatically allocate inbound transactions and invoices"},"account_category":{"type":"string","description":"Account classification: ASSET, LIABILITY, OWNERS_EQUITY, REVENUE, or EXPENSE"},"account_sub_type":{"type":"string","description":"Optional sub-type: STANDARD, BANK_CASH, CREDIT_CARD, BANK_CLEARING, AR_CONTROL, or AP_CONTROL"},"default_tax_rate_code":{"type":"string","description":"Optional default tax rate code (e.g. GST_ON_INCOME, GST_ON_EXPENSES, BAS_EXCLUDED)"},"segment_num":{"type":"number","description":"Segment number 1..10 (1=Company, 2=Natural Account (default), 3=Cost Center, 4..10=Custom dimensions such as Product, Channel, Intercompany, Project, Geography)"},"parent_code":{"type":"string","description":"Optional parent summary rollup account code (e.g. \"4000\", \"5000\", \"6000\")"},"is_summary":{"type":"boolean","description":"True if parent rollup summary account/segment (default false)"},"allow_posting":{"type":"boolean","description":"Whether journals can post to this account (default true)"},"is_active":{"type":"boolean","description":"Whether this account/segment value is active (default true)"},"accounts":{"type":"array","description":"PREFERRED FOR MULTIPLE ACCOUNTS: Batch array of accounts or segment values (segments 1..10) to create/upsert in one fast transaction","items":{"type":"object","properties":{"code":{"type":"string","description":"Account or segment code"},"account_name":{"type":"string","description":"Short display name"},"description":{"type":"string","description":"Full accounting description"},"hidden_description":{"type":"string","description":"AI allocation rules"},"account_category":{"type":"string","description":"ASSET, LIABILITY, OWNERS_EQUITY, REVENUE, or EXPENSE"},"account_sub_type":{"type":"string","description":"STANDARD, BANK_CASH, CREDIT_CARD, BANK_CLEARING, AR_CONTROL, or AP_CONTROL"},"default_tax_rate_code":{"type":"string"},"segment_num":{"type":"number","description":"Segment number 1..10 (1=Company, 2=Natural Account (default), 3=Cost Center, 4..10=Custom dimensions)"},"parent_code":{"type":"string","description":"Optional parent summary code"},"is_summary":{"type":"boolean"},"allow_posting":{"type":"boolean"},"is_active":{"type":"boolean"}},"required":["code"]}}}}},{"name":"rename_account","title":"Rename or Batch-Update Accounts / Segment Values (Segments 1..10) (v2.0.0)","description":"Rename/update a single Account or Segment Value (`code`) OR pass `accounts` (array) to batch-rename/update multiple accounts/segment values (across segments 1..10) in a single fast SQL transaction for a Set of Books (`sob_id`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/rename_account","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID whose Chart of Accounts to update (default 1)"},"code":{"type":"string","description":"Single account or segment code to update, e.g. \"4444\" or \"4010\""},"value_id":{"type":"string","description":"Optional UUID of the segment value if known"},"segment_num":{"type":"number","description":"Segment number 1..10 (1=Company, 2=Natural Account (default), 3=Cost Center, 4..10=Custom dimensions)"},"account_name":{"type":"string","description":"New short account name"},"description":{"type":"string","description":"New full accounting description"},"hidden_description":{"type":"string","description":"Updated hidden AI / AR automatic journal allocation rules"},"account_category":{"type":"string","description":"Optional classification: ASSET, LIABILITY, OWNERS_EQUITY, REVENUE, EXPENSE"},"account_sub_type":{"type":"string","description":"Optional sub-type: STANDARD, BANK_CASH, CREDIT_CARD, BANK_CLEARING, AR_CONTROL, or AP_CONTROL"},"default_tax_rate_code":{"type":"string","description":"Optional default tax rate code"},"parent_code":{"type":"string","description":"Optional parent summary code"},"is_summary":{"type":"boolean","description":"True if parent summary value"},"allow_posting":{"type":"boolean","description":"Whether posting is allowed"},"is_active":{"type":"boolean","description":"Whether account/segment value is active"},"accounts":{"type":"array","description":"PREFERRED FOR MULTIPLE ACCOUNTS: Batch array of accounts to rename/update in one fast transaction","items":{"type":"object","properties":{"code":{"type":"string","description":"Account or segment code to update"},"account_name":{"type":"string","description":"New short account name"},"description":{"type":"string","description":"New full accounting description"},"hidden_description":{"type":"string","description":"Updated AI allocation rules"},"account_category":{"type":"string","description":"ASSET, LIABILITY, OWNERS_EQUITY, REVENUE, EXPENSE"},"account_sub_type":{"type":"string"},"default_tax_rate_code":{"type":"string"},"segment_num":{"type":"number","description":"Segment number 1..10 (1=Company, 2=Natural Account (default), 3=Cost Center, 4..10=Custom dimensions)"},"parent_code":{"type":"string","description":"Optional parent summary code"},"is_summary":{"type":"boolean"},"allow_posting":{"type":"boolean"},"is_active":{"type":"boolean"}},"required":["code"]}}}}},{"name":"delete_account","title":"Delete Account or Batch of Accounts (Segments 1..10) (v2.0.0)","description":"Delete a single Account (`code`) OR pass `codes` (array of strings) to batch-delete multiple accounts/segment values from a Set of Books (`sob_id`) in one call. Safely prevents deletion if posted journal entries reference an account.","rest_action_url":"https://mcp.henda.ai/v1/gpt/delete_account","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID whose Chart of Accounts to delete from (default 1)"},"code":{"type":"string","description":"Single account or segment code to delete, e.g. \"6200\""},"codes":{"type":"array","description":"Batch array of account codes to delete in one call, e.g. [\"4444\", \"6200\"]","items":{"type":"string"}},"value_id":{"type":"string","description":"Optional value_id UUID"},"segment_num":{"type":"number","description":"Segment number 1..10 (1=Company, 2=Natural Account (default), 3=Cost Center, 4..10=Custom dimensions)"}}}},{"name":"manage_period_status","title":"Open or Close Fiscal Periods (v2.0.0)","description":"Open or Close one period (`period_name`) OR a batch of periods (`period_names` or `periods`) for a Set of Books (`sob_id`). Automatically rolls forward ending balances when opening a period.","rest_action_url":"https://mcp.henda.ai/v1/gpt/manage_period_status","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (1, 2, 3, 4...)"},"period_name":{"type":"string","description":"Single fiscal period name, e.g. \"NOV-26\" or \"OCT-26\""},"period_names":{"type":"array","description":"Batch list of fiscal period names to set to target_status, e.g. [\"SEP-26\", \"OCT-26\", \"NOV-26\"]","items":{"type":"string"}},"target_status":{"type":"string","description":"Target status: OPEN or CLOSED"}}}},{"name":"get_ledger_periods","title":"List Fiscal Periods (v2.0.0)","description":"List all fiscal periods (JUL-26 through ADJ-27) and their OPEN / CLOSED / NEVER_OPENED statuses for a Set of Books.","rest_action_url":"https://mcp.henda.ai/v1/gpt/get_ledger_periods","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (1, 2, 3...)"}}}},{"name":"post_journal_entry","title":"Post Double-Entry Journal or Batch of Journals (Actual or Budget) (v2.0.0)","description":"Post a single balanced double-entry journal (`name` + `lines`) OR pass `journals` (array) to batch-post multiple journals in one call for any Set of Books (`sob_id`). Supports both Actual journals (`actual_flag: \"A\"`) and Budget journals (`actual_flag: \"B\"` + `budget_name`). Lines specify major currency amounts (debit: 1500.00, credit: 1500.00).","rest_action_url":"https://mcp.henda.ai/v1/gpt/post_journal_entry","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (1, 2, 3, 4...)"},"name":{"type":"string","description":"Single journal batch/header title"},"description":{"type":"string","description":"Journal narrative description"},"effective_date":{"type":"string","description":"YYYY-MM-DD effective accounting date (default \"2026-10-28\")"},"period_name":{"type":"string","description":"Optional explicit period name e.g. \"OCT-26\""},"je_source":{"type":"string","description":"Oracle GL Journal Source: \"MANUAL\" (default for manual journals) or \"ACCOUNTS_RECEIVABLE\" (subledger source)"},"je_category":{"type":"string","description":"Category e.g. GENERAL, SALES, EXPENSES, TREASURY, PAYROLL, BUDGET"},"actual_flag":{"type":"string","description":"A = Actuals (default), B = Budget journal"},"budget_name":{"type":"string","description":"Budget version name when actual_flag=\"B\" (e.g. \"FY27_BOARD_JNL\")"},"created_by":{"type":"string","description":"User or agent identifier"},"lines":{"type":"array","description":"At least 2 balanced journal lines (for a single journal)","items":{"type":"object","properties":{"account_code":{"type":"string","description":"Full combination e.g. \"01-4010-300\" or 4-digit natural account e.g. \"4010\""},"debit":{"type":"number","description":"Debit amount in major currency units (e.g. 1250.00)"},"credit":{"type":"number","description":"Credit amount in major currency units (e.g. 1250.00)"},"description":{"type":"string","description":"Journal line description"}},"required":["account_code"]}},"journals":{"type":"array","description":"PREFERRED FOR MULTIPLE JOURNALS: Batch array of journals to post in a single call","items":{"type":"object","properties":{"name":{"type":"string","description":"Journal title"},"description":{"type":"string","description":"Journal narrative"},"effective_date":{"type":"string","description":"YYYY-MM-DD date"},"period_name":{"type":"string","description":"Optional period name"},"je_category":{"type":"string","description":"Category"},"actual_flag":{"type":"string","description":"A = Actuals (default), B = Budget journal"},"budget_name":{"type":"string","description":"Budget version name when actual_flag=\"B\""},"lines":{"type":"array","items":{"type":"object","properties":{"account_code":{"type":"string"},"debit":{"type":"number"},"credit":{"type":"number"},"description":{"type":"string"}},"required":["account_code"]}}},"required":["name","lines"]}}}}},{"name":"reverse_journal_entry","title":"Reverse Journal Entry (v2.0.0)","description":"Reverse a posted journal entry by its je_header_id, creating an immutable contra-journal that swaps debits and credits.","rest_action_url":"https://mcp.henda.ai/v1/gpt/reverse_journal_entry","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (1, 2, 3...)"},"je_header_id":{"type":"string","description":"UUID of the posted journal header to reverse"},"reversal_effective_date":{"type":"string","description":"Optional YYYY-MM-DD date"},"created_by":{"type":"string","description":"User or agent identifier"}},"required":["je_header_id"]}},{"name":"get_trial_balance","title":"Get Trial Balance (Actuals, Budget Versions, or Variance) (v2.0.0)","description":"Query the pre-aggregated Trial Balance for a Set of Books (sob_id 1, 2, 3...) and period (e.g. \"OCT-26\"). Supports Actuals (`actual_flag: \"A\"`), Budget/Forecast versions (`actual_flag: \"B\"`, `budget_name`), and Actual vs. Budget variance (`compare_budget_name`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/get_trial_balance","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (1=Australia, 2=New Zealand, 3=UK)"},"period_name":{"type":"string","description":"Fiscal period name, default \"OCT-26\""},"actual_flag":{"type":"string","description":"A = Actuals (default), B = Budget/Forecast balances"},"budget_name":{"type":"string","description":"Budget/Forecast version name when actual_flag=\"B\" (e.g. \"FY27_BUDGET\", \"FY27_FORECAST\")"},"compare_budget_name":{"type":"string","description":"Optional Budget/Forecast version name (e.g. \"FY27_BUDGET\") to include side-by-side Budget and Variance columns"}}}},{"name":"get_financial_statement","title":"Get P&L or Balance Sheet (Actuals, Budget Versions, or Variance) (v2.0.0)","description":"Generate a Profit & Loss (PNL) or Balance Sheet (BALANCE_SHEET) statement for a Set of Books (sob_id 1, 2, 3...) and period. Supports Actuals (`actual_flag: \"A\"`), Budget/Forecast versions (`actual_flag: \"B\"`, `budget_name`), and Actual vs. Budget variance (`compare_budget_name`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/get_financial_statement","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (1, 2, 3...)"},"period_name":{"type":"string","description":"Fiscal period name, default \"OCT-26\""},"statement_type":{"type":"string","description":"Statement type: PNL or BALANCE_SHEET"},"actual_flag":{"type":"string","description":"A = Actuals (default), B = Budget/Forecast statement"},"budget_name":{"type":"string","description":"Budget/Forecast version name when actual_flag=\"B\" (e.g. \"FY27_BUDGET\", \"FY27_FORECAST\")"},"compare_budget_name":{"type":"string","description":"Optional Budget/Forecast version name (e.g. \"FY27_BUDGET\") to compute line-by-line Actual vs Budget variance"}}}},{"name":"get_balance","title":"Evaluate Henda Excel Add-in Get_Balance Formula (Segments 1..10, Multi-SOB %, & Budget Versions) (v2.0.0)","description":"Evaluate a Henda Excel Add-in =Get_Balance(SOB_ID, Period, Balance_Type, Currency, Currency_Type, Actual_Flag, Budget_Name, Seg1..Seg10) formula with support for up to 10 segments (segment1..segment10), wildcards (%), ranges (4000-6999 or 1-3), comma lists (1010,1200), exclusions (~3), Actuals (`actual_flag: \"A\"`), and named Budget/Forecast versions (`actual_flag: \"B\"`, `budget_name: \"FY27_BUDGET\"` or `\"FY27_FORECAST\"`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/get_balance","inputSchema":{"type":"object","properties":{"sob_id":{"type":["number","string"],"description":"Set of Books ID or criteria (e.g. 1, \"%\", \"1-3\", \"1,2\", \"~3\")"},"period_name":{"type":"string","description":"Fiscal period name, default \"OCT-26\""},"balance_type":{"type":"string","description":"Balance type: YTD, PTD, QTD, BEGIN, YTD_NATURAL, or PTD_NATURAL"},"actual_flag":{"type":"string","description":"A = Actuals (default), B = Budget/Forecast balances (automatically set to B if budget_name is provided)"},"budget_name":{"type":"string","description":"Budget or Forecast version name (e.g. \"FY27_BUDGET\", \"FY27_FORECAST\", \"FY27_BOARD_JNL\"). Defaults to the CURRENT budget if actual_flag=\"B\" and omitted."},"budget_version":{"type":"string","description":"Alias for budget_name (Budget/Forecast version name)"},"segment1":{"type":"string","description":"Segment 1 (Company) filter (e.g. \"01\" or \"%\")"},"segment2":{"type":"string","description":"Segment 2 (Account) filter (e.g. \"1010\", \"1010,1200\", \"4000-6999\")"},"segment3":{"type":"string","description":"Segment 3 (Cost Center) filter (e.g. \"100\" or \"%\")"},"segment4":{"type":"string","description":"Optional Segment 4 filter (defaults to \"%\" or ignored if SOB has <4 segments)"},"segment5":{"type":"string","description":"Optional Segment 5 filter (defaults to \"%\" or ignored if SOB has <5 segments)"},"segment6":{"type":"string","description":"Optional Segment 6 filter (defaults to \"%\" or ignored if SOB has <6 segments)"},"segment7":{"type":"string","description":"Optional Segment 7 filter (defaults to \"%\" or ignored if SOB has <7 segments)"},"segment8":{"type":"string","description":"Optional Segment 8 filter (defaults to \"%\" or ignored if SOB has <8 segments)"},"segment9":{"type":"string","description":"Optional Segment 9 filter (defaults to \"%\" or ignored if SOB has <9 segments)"},"segment10":{"type":"string","description":"Optional Segment 10 filter (defaults to \"%\" or ignored if SOB has <10 segments)"}}}},{"name":"drilldown_account_activity","title":"Drilldown Account Journal / Subledger AR Invoice Activity (v2.0.0)","description":"Drill down into posted journal lines and full `source_journals` for a Set of Books (sob_id 1, 2, 3... or \"%\"), period, optional account combination (`01-1200-000` or natural account `1200`), optional `je_source` filter (`\"MANUAL\"` or `\"ACCOUNTS_RECEIVABLE\"`), and Actuals (`actual_flag: \"A\"`) or Budget version (`actual_flag: \"B\"`, `budget_name`). When a journal originates from Accounts Receivable (`je_source = \"ACCOUNTS_RECEIVABLE\"`), returns the full `source_journal` (all sibling debit/credit lines), the `source_invoice` detail (customer, dates, line items, quantities, prices, tax), and a clickable `invoice_url` (`/invoices/:sobId/:invoiceNumber`) where the actual invoice document can be opened in a browser.","rest_action_url":"https://mcp.henda.ai/v1/gpt/drilldown_account_activity","inputSchema":{"type":"object","properties":{"sob_id":{"type":["number","string"],"description":"Set of Books ID or criteria (1, 2, 3... or \"%\")"},"period_name":{"type":"string","description":"Fiscal period name, default \"OCT-26\""},"account_code":{"type":"string","description":"Optional code combination e.g. \"01-1200-000\" or natural account \"1200\""},"je_source":{"type":"string","description":"Optional Oracle GL Journal Source filter: \"MANUAL\" or \"ACCOUNTS_RECEIVABLE\""},"actual_flag":{"type":"string","description":"A = Actuals (default), B = Budget/Forecast activity"},"budget_name":{"type":"string","description":"Budget/Forecast version name when actual_flag=\"B\" (e.g. \"FY27_BUDGET\")"},"segment1":{"type":"string","description":"Optional Segment 1 filter"},"segment2":{"type":"string","description":"Optional Segment 2 filter"},"segment3":{"type":"string","description":"Optional Segment 3 filter"},"segment4":{"type":"string","description":"Optional Segment 4 filter"},"segment5":{"type":"string","description":"Optional Segment 5 filter"},"segment6":{"type":"string","description":"Optional Segment 6 filter"},"segment7":{"type":"string","description":"Optional Segment 7 filter"},"segment8":{"type":"string","description":"Optional Segment 8 filter"},"segment9":{"type":"string","description":"Optional Segment 9 filter"},"segment10":{"type":"string","description":"Optional Segment 10 filter"}}}},{"name":"suggest_ai_transaction_allocation","title":"Suggest AI Transaction Allocation (v2.0.0)","description":"Phase 2 AI/AR Brain: Analyze an inbound transaction description, counterparty, and amount against every account's account_name, description, and hidden_description (AI allocation rules) to recommend or auto-post the Debit & Credit journal entry.","rest_action_url":"https://mcp.henda.ai/v1/gpt/suggest_ai_transaction_allocation","inputSchema":{"type":"object","properties":{"transaction_description":{"type":"string","description":"Inbound bank feed, invoice, or transaction narrative"},"amount":{"type":"number","description":"Transaction amount in major currency units, e.g. 2450.00"},"direction":{"type":"string","description":"Optional direction: INBOUND_RECEIPT, OUTBOUND_PAYMENT, INVOICE_ISSUED, or BILL_RECEIVED"},"counterparty":{"type":"string","description":"Optional customer or supplier name"},"sob_id":{"type":"number","description":"Set of Books ID (1, 2, 3...)"},"auto_post":{"type":"boolean","description":"Set true to immediately post the recommended balanced journal entry"}},"required":["transaction_description","amount"]}},{"name":"run_year_end_close","title":"Run Year-End Close (v2.0.0)","description":"Run the Year-End Close process for a Set of Books: close all YTD Revenue & Expense balances into Retained Earnings (3200) and close the fiscal period.","rest_action_url":"https://mcp.henda.ai/v1/gpt/run_year_end_close","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (1, 2, 3...)"},"closing_period_name":{"type":"string","description":"Fiscal period to close, e.g. \"OCT-26\""},"retained_earnings_account_code":{"type":"string","description":"Optional Retained Earnings account code (default 3200)"},"close_period_after":{"type":"boolean","description":"Whether to mark the period CLOSED after posting the closing entry"}}}},{"name":"manage_users_and_sob_access","title":"Manage Users, Workspace Invitations & SOB Access (v2.0.0)","description":"List organization users, invite a new user with Set of Books permissions and send an invitation email via Resend (`invite`), accept an invitation token to activate the user and issue a Personal Access Token (`accept_invitation`), generate a user-level Personal Access Token (`create_token`), toggle SOB access (`toggle_access`), preview accessible Sets of Books (`preview_books`), or switch the active cached Sets of Books session (`login`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/manage_users_and_sob_access","inputSchema":{"type":"object","properties":{"action":{"type":"string","enum":["list","invite","accept_invitation","create_token","toggle_access","preview_books","login"],"description":"Action to perform: list, invite, accept_invitation, create_token, toggle_access, preview_books, or login"},"tenant_id":{"type":"string","description":"Optional target tenant UUID"},"username":{"type":"string","description":"Username"},"email":{"type":"string","description":"Email address"},"full_name":{"type":"string","description":"Full display name"},"password":{"type":"string","description":"Password"},"role":{"type":"string","description":"User role e.g. ORG_ADMIN, ACCOUNTANT, AUDITOR, VIEWER"},"sob_ids":{"type":"array","items":{"type":"number"},"description":"List of Set of Books IDs (e.g. [1, 2, 3]) to grant access to when inviting a user or logging in"},"sob_permissions":{"type":"array","description":"Explicit per-book permissions [{ sob_id, can_query, can_post }]","items":{"type":"object","properties":{"sob_id":{"type":"number"},"can_query":{"type":"boolean"},"can_post":{"type":"boolean"}},"required":["sob_id"]}},"send_invite_email":{"type":"boolean","description":"Whether to send invitation email via Resend (default true)"},"invite_token":{"type":"string","description":"Invitation token (henda_inv_...) when action=\"accept_invitation\""},"token_name":{"type":"string","description":"Personal Access Token label when action=\"accept_invitation\" or \"create_token\""},"allowed_sob_ids":{"type":["string","array"],"description":"Allowed SOB IDs (\"*\" or subset array) for user-level token"},"user_id":{"type":"string","description":"User UUID for toggle_access or create_token"},"sob_id":{"type":"number","description":"Set of Books ID for toggle_access"},"enabled":{"type":"boolean","description":"Enable or disable SOB access"},"can_post":{"type":"boolean","description":"Whether user has write/posting access on the SOB"},"username_or_email":{"type":"string","description":"Username or email for login / preview_books"}}}},{"name":"create_budget","title":"Create Oracle GL Budget or Forecast Version (v2.0.0)","description":"Create a new Oracle GL Budget or Forecast version linked to a Set of Books (`sob_id`). Automatically inherits all fiscal periods in the Set of Books' fiscal year (e.g. JUL-26 through ADJ-27). Set `require_budget_journals: true` to require formal double-entry budget journals, or `require_budget_journals: false` (default) to allow direct top-level balance injection into `gl_balances`. Optionally copy balances from an existing budget version via `copy_from_budget_name`.","rest_action_url":"https://mcp.henda.ai/v1/gpt/create_budget","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (1, 2, 3...) this Budget/Forecast is linked to"},"budget_name":{"type":"string","description":"Unique Budget or Forecast version name, e.g. \"FY27_BUDGET\", \"FY27_Q2_FORECAST\", \"FY27_STRETCH\""},"description":{"type":"string","description":"Description of this budget or forecast version"},"budget_type":{"type":"string","description":"BUDGET or FORECAST"},"status":{"type":"string","description":"OPEN, CURRENT (default budget for the Set of Books), or FROZEN (read-only)"},"require_budget_journals":{"type":"boolean","description":"Oracle REQUIRE_BUDGET_JOURNALS_FLAG: if false (default), budget amounts can be directly injected into gl_balances without journals; if true, updates require formal budget journals"},"fiscal_year":{"type":"number","description":"Fiscal year to inherit periods from (default 2027)"},"first_valid_period_name":{"type":"string","description":"Optional first valid period (default \"JUL-26\")"},"last_valid_period_name":{"type":"string","description":"Optional last valid period (default \"ADJ-27\")"},"copy_from_budget_name":{"type":"string","description":"Optional existing budget version name to clone all period balances from"}},"required":["budget_name"]}},{"name":"list_budgets","title":"List Oracle GL Budgets & Forecast Versions (v2.0.0)","description":"List all Oracle GL Budgets and Forecast versions defined for a Set of Books (`sob_id`) or across all Sets of Books, including inherited period ranges (`first_valid_period_name` to `last_valid_period_name`), `require_budget_journals` flag, status (`OPEN`, `CURRENT`, `FROZEN`), posted budget journal count, and total budgeted amounts.","rest_action_url":"https://mcp.henda.ai/v1/gpt/list_budgets","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Optional Set of Books ID filter (1, 2, 3...)"}}}},{"name":"update_budget","title":"Update Budget / Forecast Version Status or Journal Requirement (v2.0.0)","description":"Update an existing Budget or Forecast version's `status` (`OPEN`, `CURRENT`, `FROZEN`), `require_budget_journals` flag (`true` or `false`), `budget_type` (`BUDGET` or `FORECAST`), `description`, or valid period range.","rest_action_url":"https://mcp.henda.ai/v1/gpt/update_budget","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (1, 2, 3...)"},"budget_name":{"type":"string","description":"Budget version name to update, e.g. \"FY27_BUDGET\""},"budget_id":{"type":"string","description":"Optional budget_id UUID"},"status":{"type":"string","description":"OPEN, CURRENT, or FROZEN"},"require_budget_journals":{"type":"boolean","description":"Toggle whether this budget version requires formal budget journals (true) or allows direct gl_balances injection (false)"},"budget_type":{"type":"string","description":"BUDGET or FORECAST"},"description":{"type":"string","description":"Updated description"}}}},{"name":"inject_budget_balances","title":"Inject Budget / Forecast Balances Directly into gl_balances (v2.0.0)","description":"Directly inject or update budget/forecast amounts in the top-level `gl_balances` table (`actual_flag = \"B\"`, linked to `budget_name`) WITHOUT creating journal entries, when `require_budget_journals = false` on the target budget. Supports single-period amounts (`period_name` + `amount` or `debit`/`credit`), multi-period maps (`periods: { \"JUL-26\": 10000, \"AUG-26\": 12000 }`), or 12-month annual spreading (`annual_amount` + `spread_rule: \"EVEN\" | \"4_4_5\"`), and automatically rolls forward YTD balances across all fiscal periods.","rest_action_url":"https://mcp.henda.ai/v1/gpt/inject_budget_balances","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (1, 2, 3...)"},"budget_name":{"type":"string","description":"Target Budget or Forecast version name, e.g. \"FY27_BUDGET\" or \"FY27_FORECAST\" (must have require_budget_journals = false and status != FROZEN)"},"mode":{"type":"string","description":"REPLACE (default) overwrites period budget balances for the specified account/period; ADD increments existing budget balances"},"entries":{"type":"array","description":"Array of account budget balance entries to directly inject into gl_balances","items":{"type":"object","properties":{"account_code":{"type":"string","description":"Full code combination (e.g. \"01-4010-100\") or 4-digit natural account (e.g. \"4010\" or \"5200\")"},"period_name":{"type":"string","description":"Single fiscal period name (e.g. \"OCT-26\") when injecting a single period"},"amount":{"type":"number","description":"Budget amount in major currency units using natural sign"},"debit":{"type":"number","description":"Explicit Debit amount in major currency units"},"credit":{"type":"number","description":"Explicit Credit amount in major currency units"},"periods":{"type":"object","description":"Map of period_name -> amount in major units for multi-period injection"},"annual_amount":{"type":"number","description":"Total annual budget amount in major currency units to spread across all 12 periods of the fiscal year"},"spread_rule":{"type":"string","description":"EVEN (default) or 4_4_5"}},"required":["account_code"]}}},"required":["budget_name","entries"]}},{"name":"generate_excel_report","title":"Generate Live Henda Excel Add-in Report (.xlsx with =Get_Balance Formulas)","description":"Generates a formatted Microsoft Excel (.xlsx) workbook populated with live =Get_Balance($C$4, $C$5, $C$6, $C$7, \"E\", \"A\", \"\", $F$4, $A11, $B11) formulas, pre-calculated numeric values, and an interactive Yellow Parameter Block ($C$4 = SOB_ID, $C$5 = Period, $C$6 = Balance_Type, $C$7 = Currency, $C$8 = Budget_Name, $F$4 = Company Seg1, $F$5 = Cost Center Seg3). Supports report_type = \"FINANCIAL_PACK\" (3 tabs: P&L, Balance Sheet, Trial Balance), \"PNL\", \"BALANCE_SHEET\", \"TRIAL_BALANCE\", \"MULTI_PERIOD_TREND\" (side-by-side period columns), \"MULTI_BOOK_CONSOLIDATION\" (side-by-side Set of Books columns), or \"CUSTOM\". Returns a direct clickable download_url.","rest_action_url":"https://mcp.henda.ai/v1/gpt/generate_excel_report","inputSchema":{"type":"object","properties":{"sob_id":{"type":["number","string"],"description":"Set of Books ID (e.g. 1, 2, 3, 4, or \"%\"). Default 1."},"report_type":{"type":"string","enum":["FINANCIAL_PACK","PNL","BALANCE_SHEET","TRIAL_BALANCE","MULTI_PERIOD_TREND","MULTI_BOOK_CONSOLIDATION","CUSTOM"],"description":"Report template to generate. Default \"FINANCIAL_PACK\" (creates P&L Statement, Balance Sheet, and Trial Balance tabs in one .xlsx workbook)."},"title":{"type":"string","description":"Optional custom title banner for the Excel worksheet."},"period_name":{"type":"string","description":"Default accounting period in cell $C$5 (e.g. \"OCT-26\")."},"periods":{"type":"array","items":{"type":"string"},"description":"For MULTI_PERIOD_TREND: array of periods across columns (e.g. [\"JUL-26\", \"AUG-26\", \"SEP-26\", \"OCT-26\", \"NOV-26\"])."},"sob_ids":{"type":"array","items":{"type":["number","string"]},"description":"For MULTI_BOOK_CONSOLIDATION: array of Set of Books IDs across columns (e.g. [1, 2, 3, 4])."},"balance_type":{"type":"string","enum":["YTD","PTD","QTD","YTD_NATURAL","PTD_NATURAL"],"description":"Default balance type in cell $C$6 (default \"YTD_NATURAL\" for P&L/BS, \"YTD\" for TB)."},"include_budget_comparison":{"type":"boolean","description":"If true, adds Actual, Budget (=Get_Balance with Actual_Flag=\"B\"), Variance ($), and Variance (%) columns."},"budget_name":{"type":"string","description":"Budget version name in cell $C$8 (e.g. \"FY27_BUDGET\" or \"FY27_FORECAST\")."},"company_code":{"type":"string","description":"Default Segment 1 (Company) filter in cell $F$4 (default \"%\")."},"cost_center":{"type":"string","description":"Default Segment 3 (Cost Center) filter in cell $F$5 (default \"%\")."},"custom_rows":{"type":"array","description":"For CUSTOM reports: array of custom rows with account_code (supports wildcards \"%\", ranges \"4000-4999\", lists \"1010,1200\", exclusions \"~1200\"), cost_center, and description.","items":{"type":"object","properties":{"account_code":{"type":"string"},"cost_center":{"type":"string"},"description":{"type":"string"}},"required":["account_code"]}},"open_in_excel":{"type":"boolean","description":"If true on a local Windows machine, opens the generated .xlsx directly in Microsoft Excel."}}}},{"name":"list_bank_accounts","title":"List Bank Accounts, Special Account Sub-Types & Recon Rules (v2.0.0)","description":"List all Oracle Cash Management (CE) Bank Accounts (`ce_bank_accounts`), designated Bank/Credit Card/Clearing GL accounts (`account_sub_type`), Set of Books bank reconciliation posting mode (`bank_recon_posting_mode`: `AUTO_POST_HIGH_CONFIDENCE` | `REVIEW_ALL` | `AUTO_POST_ALL`), and deterministic bank reconciliation rules (`ce_reconciliation_rules`) for a Set of Books (`sob_id`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/list_bank_accounts","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (1, 2, 3...). Default 1."}}}},{"name":"upsert_bank_account","title":"Create or Update Bank Account & Designate GL Account Sub-Type (v2.0.0)","description":"Create or update an Oracle Cash Management (CE) Bank Account (`ce_bank_accounts`) and automatically designate its linked GL natural account with `account_sub_type` (`BANK_CASH` or `CREDIT_CARD`). Links the bank account to its primary GL Cash CCID (`gl_account_code`), optional Bank Clearing (`1015`), Bank Charges (`6100`), Interest Income (`4020`), and Suspense (`1200`) accounts.","rest_action_url":"https://mcp.henda.ai/v1/gpt/upsert_bank_account","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"bank_account_code":{"type":"string","description":"Short bank account code, e.g. \"CBA-AUD-OP\" or \"AMEX-CORP\""},"bank_account_name":{"type":"string","description":"Display name of the bank account"},"bank_name":{"type":"string","description":"Bank institution name"},"branch_bsb_routing":{"type":"string","description":"BSB, Sort Code, or Routing number"},"account_number_masked":{"type":"string","description":"Masked account number, e.g. \"****1010\""},"currency_code":{"type":"string","description":"3-letter currency code"},"account_type":{"type":"string","enum":["CHECKING","SAVINGS","CREDIT_CARD","MERCHANT_CLEARING","LOAN"]},"gl_account_code":{"type":"string","description":"GL Natural Account code (e.g. \"1010\") or full combination (e.g. \"01-1010-000\")"},"clearing_account_code":{"type":"string"},"bank_charges_account_code":{"type":"string"},"interest_income_account_code":{"type":"string"},"unidentified_A_account_code":{"type":"string"},"default_cost_center_code":{"type":"string"}},"required":["bank_account_name","gl_account_code"]}},{"name":"update_sob_bank_recon_settings","title":"Update Set of Books Bank Reconciliation Posting Mode (v2.0.0)","description":"Update the Set of Books (`sob_id`) Bank Reconciliation Posting Mode (`bank_recon_posting_mode`: `AUTO_POST_HIGH_CONFIDENCE` | `REVIEW_ALL` | `AUTO_POST_ALL`) and date matching tolerance (`bank_recon_match_days_tolerance` in days).","rest_action_url":"https://mcp.henda.ai/v1/gpt/update_sob_bank_recon_settings","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"bank_recon_posting_mode":{"type":"string","enum":["AUTO_POST_HIGH_CONFIDENCE","REVIEW_ALL","AUTO_POST_ALL"],"description":"AUTO_POST_HIGH_CONFIDENCE (default), REVIEW_ALL (stages all suggestions for user review before posting), or AUTO_POST_ALL"},"bank_recon_match_days_tolerance":{"type":"number","description":"Date tolerance in days when matching imported bank statement lines against existing posted GL journals (default 7)"}}}},{"name":"upsert_bank_reconciliation_rule","title":"Create or Update Deterministic Bank Reconciliation Rule (v2.0.0)","description":"Create or update a deterministic Bank Reconciliation Rule (`ce_reconciliation_rules`) that matches bank statement narratives or counterparties and allocates them to a target GL account and cost center (with optional tax split).","rest_action_url":"https://mcp.henda.ai/v1/gpt/upsert_bank_reconciliation_rule","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"bank_account_id":{"type":"string"},"rule_name":{"type":"string","description":"Rule name, e.g. \"AWS Cloud Hosting\""},"priority":{"type":"number","description":"Evaluation priority (lower number runs first, default 50)"},"match_field":{"type":"string","enum":["DESCRIPTION","COUNTERPARTY","REFERENCE","ANY"]},"match_operator":{"type":"string","enum":["CONTAINS","STARTS_WITH","EXACT","REGEX"]},"match_pattern":{"type":"string","description":"Keyword or pattern to match, e.g. \"AWS\""},"trx_type":{"type":"string","enum":["DEPOSIT","PAYMENT","ANY"]},"target_account_code":{"type":"string","description":"Target GL Natural Account (e.g. \"5100\") or full combination"},"target_cost_center_code":{"type":"string","description":"Default \"100\""},"tax_account_code":{"type":"string"},"tax_rate_percent":{"type":"number"},"auto_post":{"type":"boolean"}},"required":["rule_name","match_pattern","target_account_code"]}},{"name":"preview_bank_statement_import","title":"Bank Statement Import Wizard — Step 1: Auto-Detect & Preview Mapping (v2.0.0)","description":"Parses raw CSV, TSV, OFX/QFX, CAMT.053 XML, or JSON bank exports, auto-detects the format, date convention (DD/MM/YYYY vs MM/DD/YYYY), and column mapping (Date, Description, Amount or Debit/Credit, Counterparty, Reference, Running Balance), normalizes sign polarity, and checks for duplicate lines.","rest_action_url":"https://mcp.henda.ai/v1/gpt/preview_bank_statement_import","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"bank_account_id":{"type":"string"},"bank_account_code":{"type":"string"},"raw_content":{"type":"string","description":"Raw CSV, TSV, OFX/QFX, CAMT.053 XML, or JSON string from bank export"},"source_format":{"type":"string","enum":["CSV","TSV","OFX","CAMT053","JSON"]},"opening_balance":{"type":"number"},"closing_balance":{"type":"number"}},"required":["raw_content"]}},{"name":"import_bank_statement","title":"Bank Statement Import Wizard — Step 2: Import & Reconcile (v2.0.0)","description":"Imports bank statement lines into `ce_statement_headers` and `ce_statement_lines` (from `raw_content` CSV/OFX/CAMT.053/JSON or structured `lines`), deduplicates overlapping imports via `line_fingerprint`, and by default (`auto_process: true`) runs the 3-Tier Bank Reconciliation Engine respecting the Set of Books `bank_recon_posting_mode`.","rest_action_url":"https://mcp.henda.ai/v1/gpt/import_bank_statement","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"bank_account_id":{"type":"string"},"bank_account_code":{"type":"string"},"gl_account_code":{"type":"string"},"statement_number":{"type":"string"},"statement_date":{"type":"string"},"period_name":{"type":"string"},"opening_balance":{"type":"number"},"closing_balance":{"type":"number"},"source_format":{"type":"string","enum":["CSV","TSV","OFX","CAMT053","JSON"]},"raw_content":{"type":"string","description":"Raw CSV, TSV, OFX/QFX, CAMT.053 XML, or JSON bank export content"},"lines":{"type":"array","items":{"type":"object","properties":{"trx_date":{"type":"string"},"description":{"type":"string"},"amount":{"type":"number"},"debit":{"type":"number"},"credit":{"type":"number"},"trx_type":{"type":"string","enum":["DEPOSIT","PAYMENT"]},"counterparty_name":{"type":"string"},"bank_reference":{"type":"string"}},"required":["trx_date","description"]}},"auto_process":{"type":"boolean","description":"Automatically run 3-Tier reconciliation after import (default true)"},"posting_mode_override":{"type":"string","enum":["AUTO_POST_HIGH_CONFIDENCE","REVIEW_ALL","AUTO_POST_ALL"]}}}},{"name":"process_bank_statement","title":"Run 3-Tier Bank Statement Reconciliation Engine (v2.0.0)","description":"Run the 3-Tier Bank Statement Reconciliation Engine on imported statement lines: Tier 1 matches existing unreconciled GL journal lines on the Bank CCID (`MATCHED_EXISTING_JOURNAL`), Tier 2 evaluates deterministic Bank Rules + AI Accountant Brain (`AUTO_POSTED` or `AI_SUGGESTED` depending on the SOB `bank_recon_posting_mode`), and Tier 3 flags ambiguous lines as `NEEDS_USER_INPUT` with a specific question and candidate accounts.","rest_action_url":"https://mcp.henda.ai/v1/gpt/process_bank_statement","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"statement_header_id":{"type":"string"},"bank_account_id":{"type":"string"},"bank_account_code":{"type":"string"},"posting_mode_override":{"type":"string","enum":["AUTO_POST_HIGH_CONFIDENCE","REVIEW_ALL","AUTO_POST_ALL"]}}}},{"name":"resolve_bank_statement_lines","title":"Resolve Bank Statement Exception / Review Lines (v2.0.0)","description":"Resolve one or more Bank Statement lines that are in `NEEDS_USER_INPUT`, `AI_SUGGESTED`, or `UNPROCESSED` status: approve AI/Rule suggestions (`APPROVE_SUGGESTION`), post to a user-specified GL account or multi-line split (`POST_NEW_JOURNAL`), link to an existing GL journal (`MATCH_EXISTING_JOURNAL`), or exclude (`IGNORE`). Optionally saves the allocation as a reusable Bank Rule (`save_as_rule: true`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/resolve_bank_statement_lines","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"resolutions":{"type":"array","items":{"type":"object","properties":{"statement_line_id":{"type":"string"},"action":{"type":"string","enum":["POST_NEW_JOURNAL","APPROVE_SUGGESTION","MATCH_EXISTING_JOURNAL","IGNORE"]},"target_account_code":{"type":"string"},"cost_center_code":{"type":"string"},"description":{"type":"string"},"je_header_id":{"type":"string"},"save_as_rule":{"type":"boolean"},"rule_match_pattern":{"type":"string"},"append_to_accountant_brain":{"type":"boolean"}},"required":["statement_line_id","action"]}}},"required":["resolutions"]}},{"name":"get_bank_reconciliation_report","title":"Get Bank Reconciliation Report & Exception Queue (v2.0.0)","description":"Generate a comprehensive Bank Reconciliation Report for a Set of Books (`sob_id`) and Bank Account: compares Statement Closing Balance vs. GL Cash Account YTD Balance (`gl_balances`), lists all imported statements (`ce_statement_headers`), breaks down statement lines by status (`MATCHED_EXISTING_JOURNAL`, `AUTO_POSTED`, `USER_POSTED`, `AI_SUGGESTED`, `NEEDS_USER_INPUT`, `UNPROCESSED`), highlights the Action Queue requiring user review/input, and lists Unreconciled GL Cash Journal Lines.","rest_action_url":"https://mcp.henda.ai/v1/gpt/get_bank_reconciliation_report","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"bank_account_id":{"type":"string"},"bank_account_code":{"type":"string"},"statement_header_id":{"type":"string"},"period_name":{"type":"string","description":"Default \"OCT-26\""}}}},{"name":"get_ar_setup","title":"Get Accounts Receivable Subledger Setup & GL Mapping (v2.0.0)","description":"Get the Accounts Receivable subledger onboarding status and General Ledger Control Account mappings (`ar_control_account_code`, `default_tax_account_code`, `default_sales_account_code`, `default_cost_center_code`) for a Set of Books (`sob_id`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/get_ar_setup","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"}}}},{"name":"configure_ar_setup","title":"Configure Accounts Receivable Setup & Map GL Control Accounts (v2.0.0)","description":"Onboard or update the Accounts Receivable subledger for a Set of Books (`sob_id`) by mapping it to existing postable GL accounts (`ar_control_account_code`, `default_tax_account_code`, `default_sales_account_code`) or creating missing GL control accounts inline (`create_ar_control_account`, `create_tax_control_account`, `create_sales_account`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/configure_ar_setup","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"ar_control_account_code":{"type":"string","description":"Postable GL Asset account code for Accounts Receivable Control (e.g. \"1200\")"},"default_tax_account_code":{"type":"string","description":"Postable GL Liability account code for Tax / GST / VAT Payable Control (e.g. \"2100\")"},"default_sales_account_code":{"type":"string","description":"Postable GL Revenue account code for Default Sales Revenue (e.g. \"4010\")"},"default_cost_center_code":{"type":"string","description":"Default Cost Center / Division code (e.g. \"300\" or \"000\")"},"default_payment_terms_days":{"type":"number","description":"Default customer payment terms in days (default 14)"},"invoice_prefix":{"type":"string","description":"Invoice number prefix (default \"INV-\")"},"seed_default_tax_rates":{"type":"boolean","description":"Whether to seed default tax rates and update tax rates to use the mapped GL Tax Control Account"},"create_ar_control_account":{"type":"object","properties":{"code":{"type":"string"},"account_name":{"type":"string"},"parent_code":{"type":"string"}},"required":["code"]},"create_tax_control_account":{"type":"object","properties":{"code":{"type":"string"},"account_name":{"type":"string"},"parent_code":{"type":"string"}},"required":["code"]},"create_sales_account":{"type":"object","properties":{"code":{"type":"string"},"account_name":{"type":"string"},"parent_code":{"type":"string"}},"required":["code"]}}}},{"name":"list_tax_rates","title":"List Tax Rates & Account Usage Counts (v2.0.0)","description":"List all Tax Rates (`ar_tax_rates`) configured for a Set of Books (`sob_id`), including `tax_code`, display `name` (e.g. \"GST on Income\", \"BAS Excluded\", \"GST Free Income\", \"GST on Expenses\"), effective `rate_percent`, multi-component breakdown, `tax_account_code`, `tax_account_name`, and the count of GL accounts and products using each tax rate.","rest_action_url":"https://mcp.henda.ai/v1/gpt/list_tax_rates","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"}}}},{"name":"upsert_tax_rate","title":"Create or Update Tax Rate (v2.0.0)","description":"Create or update a Tax Rate (`ar_tax_rates`) for a Set of Books (`sob_id`), with optional `tax_rate_id`, multi-component tax breakdown, `tax_account_code` mapping, and optional GL account assignments (`assign_to_account_codes`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/upsert_tax_rate","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"tax_rate_id":{"type":"string","description":"Optional UUID of an existing tax rate to edit"},"tax_code":{"type":"string","description":"Unique tax code e.g. \"GST_ON_INCOME\""},"name":{"type":"string","description":"Display name e.g. \"GST on Income\""},"rate_percent":{"type":"number","description":"Effective tax rate percentage e.g. 10"},"tax_type":{"type":"string","enum":["SALES","PURCHASES","EXEMPT","NONE","BOTH"]},"tax_account_code":{"type":"string","description":"GL Tax Control account code (defaults to the Set of Books mapped Tax Control Account)"},"components":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"rate_percent":{"type":"number"},"compound":{"type":"boolean"}},"required":["name","rate_percent"]}},"assign_to_account_codes":{"type":"array","items":{"type":"string"},"description":"GL natural account codes whose default_tax_rate_code should be set to this tax rate"}},"required":["name"]}},{"name":"delete_tax_rate","title":"Delete Custom Tax Rate (v2.0.0)","description":"Delete a non-system Tax Rate (`ar_tax_rates`) that is not referenced by any invoice lines.","rest_action_url":"https://mcp.henda.ai/v1/gpt/delete_tax_rate","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"tax_rate_id":{"type":"string"},"tax_code":{"type":"string"}}}},{"name":"list_ar_contacts","title":"List Contacts (Customers & Suppliers) & Overdue Balances (v2.0.0)","description":"List Contacts (`ar_contacts` — Customers, Suppliers, or Both) for a Set of Books (`sob_id`), including contact details, primary contact person, address, and real-time \"Invoices owed to you\" / \"Overdue\" balance summaries and invoice lists.","rest_action_url":"https://mcp.henda.ai/v1/gpt/list_ar_contacts","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"contact_type":{"type":"string","enum":["CUSTOMER","SUPPLIER","BOTH","ALL"]},"search":{"type":"string"}}}},{"name":"upsert_ar_contact","title":"Create or Update Contact (Customer / Supplier) (v2.0.0)","description":"Create or update a Contact (`ar_contacts`) in Accounts Receivable / Payable. Defaults `contact_type` to `CUSTOMER` (also supports `SUPPLIER` or `BOTH`), with primary contact person, email, street address, city, state/region, postal code, payment terms (`payment_terms_days`), and default revenue account / tax rate.","rest_action_url":"https://mcp.henda.ai/v1/gpt/upsert_ar_contact","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"contact_id":{"type":"string"},"contact_code":{"type":"string","description":"Short badge code e.g. \"NGP\""},"name":{"type":"string","description":"Customer / Supplier legal name e.g. \"NeedCover Group Pty Ltd\""},"contact_type":{"type":"string","enum":["CUSTOMER","SUPPLIER","BOTH"]},"primary_person_name":{"type":"string","description":"e.g. \"Grant Elliott\""},"email":{"type":"string","description":"e.g. \"grant@needcover.com.au\""},"phone":{"type":"string"},"street_address":{"type":"string","description":"e.g. \"Level 1 172 Evans Rd\""},"city":{"type":"string","description":"e.g. \"SALISBURY\""},"state_region":{"type":"string","description":"e.g. \"QLD\""},"postal_code":{"type":"string","description":"e.g. \"4107\""},"country":{"type":"string"},"tax_number_abn":{"type":"string"},"payment_terms_days":{"type":"number"},"default_sales_account_code":{"type":"string","description":"Preferred GL revenue account e.g. \"4010\" or \"4020\""},"default_tax_rate_code":{"type":"string","description":"Preferred tax rate code e.g. \"GST_ON_INCOME\""},"default_cost_center_code":{"type":"string","description":"Preferred cost center / division e.g. \"300\""}},"required":["name"]}},{"name":"list_ar_products","title":"List Non-Inventory Products & Services (v2.0.0)","description":"List non-inventory Products & Services (`ar_products`) for a Set of Books (`sob_id`), including item `code` (e.g. \"AppDev\", \"BS\", \"PM\"), `name`, `sale_price`, preferred GL `sales_account_code` (\"4010\", \"4020\"), `sales_tax_rate_code`, `default_cost_center_code`, and `description`.","rest_action_url":"https://mcp.henda.ai/v1/gpt/list_ar_products","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"search":{"type":"string"},"include_inactive":{"type":"boolean","description":"Include archived/inactive products (default false)"}}}},{"name":"upsert_ar_product","title":"Create or Update Non-Inventory Product or Service (v2.0.0)","description":"Create or update a non-inventory Product or Service (`ar_products`, `track_inventory = false` in Products & Services): defines `code`, `name`, `sale_price`, preferred GL `sales_account_code`, `sales_tax_rate_code`, `default_cost_center_code`, and `description`.","rest_action_url":"https://mcp.henda.ai/v1/gpt/upsert_ar_product","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"product_id":{"type":"string"},"code":{"type":"string","description":"Required item code e.g. \"AppDev\", \"BS\", \"PM\""},"name":{"type":"string","description":"Product or service name e.g. \"App Development\""},"sale_price":{"type":"number","description":"Default unit sale price e.g. 1500.00"},"sales_account_code":{"type":"string","description":"Preferred GL revenue natural account e.g. \"4010\" or \"4020\""},"sales_tax_rate_code":{"type":"string","description":"Default tax rate code e.g. \"GST_ON_INCOME\""},"default_cost_center_code":{"type":"string","description":"Default Cost Center / Division e.g. \"300\""},"description":{"type":"string","description":"Default invoice line description"}},"required":["code","name"]}},{"name":"delete_ar_product","title":"Delete, Archive, or Restore Product or Service (v2.0.0)","description":"Delete, archive (`mode: \"ARCHIVE\"`), or restore (`mode: \"RESTORE\"`) a Product or Service (`ar_products`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/delete_ar_product","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"product_id":{"type":"string"},"code":{"type":"string"},"mode":{"type":"string","enum":["AUTO","ARCHIVE","DELETE","RESTORE"],"description":"AUTO (default), ARCHIVE, DELETE, or RESTORE"}}}},{"name":"list_ar_invoices","title":"List AR Invoices, Line Items & GL Posting Flags (v2.0.0)","description":"List Accounts Receivable Invoices (`ar_invoices`) with their line items, payments, invoice status (`DRAFT`, `AWAITING_APPROVAL`, `AWAITING_PAYMENT`, `PARTIALLY_PAID`, `PAID`, `VOIDED`), and GL Posting & Closed-Period flags (`gl_posted_flag`, `gl_posting_status`, `issue_date_period_name`, `issue_date_period_status`, `gl_period_name`, `gl_je_header_id`, `gl_posting_error`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/list_ar_invoices","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"contact_id":{"type":"string"},"status":{"type":"string"},"gl_posting_status":{"type":"string"},"search":{"type":"string"}}}},{"name":"get_ar_invoice","title":"Get Single AR Invoice with Line Items, Payments & GL Journal Details (v2.0.0)","description":"Retrieve a single Accounts Receivable Invoice (`ar_invoices`) by `invoice_id` or `invoice_number` (e.g. \"INV-0168\"), including its line items, recorded payments, customer contact details, and linked GL journal status.","rest_action_url":"https://mcp.henda.ai/v1/gpt/get_ar_invoice","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"invoice_id":{"type":"string","description":"Invoice UUID"},"invoice_number":{"type":"string","description":"Invoice number e.g. \"INV-0168\""}}}},{"name":"create_ar_invoice","title":"Create or Update Multi-Line AR Invoice (v2.0.0)","description":"Create or update a multi-line AR Sales Invoice (`ar_invoices` & `ar_invoice_lines`). Lines can either reference a defined Product (`item_code` / `product_id`, inheriting its preferred GL account, price, tax rate, and description) OR be completely freeform (`description`, `quantity`, `unit_price`, `account_code`, `tax_rate_code`, `division_code`). Follows Henda GL rules: `DRAFT` / `AWAITING_APPROVAL` invoices do not hit the GL (`gl_posted_flag = false`); when `status = \"AWAITING_PAYMENT\"` or `approve_immediately = true`, it automatically posts a balanced journal to the GL if the issue date period is OPEN, or flags `BLOCKED_PERIOD_NOT_OPEN` if the period is closed/unopened.","rest_action_url":"https://mcp.henda.ai/v1/gpt/create_ar_invoice","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"invoice_number":{"type":"string","description":"Optional invoice number e.g. \"INV-0169\""},"contact_id":{"type":"string"},"contact_name":{"type":"string","description":"Customer name e.g. \"NeedCover Group Pty Ltd\""},"issue_date":{"type":"string","description":"YYYY-MM-DD (default \"2026-10-30\")"},"due_date":{"type":"string","description":"YYYY-MM-DD"},"reference":{"type":"string"},"tax_amount_type":{"type":"string","enum":["TAX_EXCLUSIVE","TAX_INCLUSIVE","NO_TAX"]},"status":{"type":"string","enum":["DRAFT","AWAITING_APPROVAL","AWAITING_PAYMENT"]},"approve_immediately":{"type":"boolean"},"auto_post_to_gl":{"type":"boolean"},"closed_period_policy":{"type":"string","enum":["FLAG_PENDING","ERROR","SWEEP_TO_OPEN_PERIOD","OPEN_PERIOD_IF_NEVER_OPENED"]},"target_open_period_name":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"item_code":{"type":"string","description":"Optional product code e.g. \"AppDev\", \"BS\", \"PM\""},"description":{"type":"string"},"quantity":{"type":"number"},"unit_price":{"type":"number"},"discount_percent":{"type":"number"},"account_code":{"type":"string","description":"GL Revenue account e.g. \"4010\" or \"4020\""},"tax_rate_code":{"type":"string","description":"e.g. \"GST_ON_INCOME\", \"GST_FREE_INCOME\""},"division_code":{"type":"string","description":"Cost center e.g. \"300\""}}}}},"required":["lines"]}},{"name":"approve_ar_invoice","title":"Approve AR Invoice & Post to GL (v2.0.0)","description":"Approve a `DRAFT` or `AWAITING_APPROVAL` AR Invoice (transitions status to `AWAITING_PAYMENT` and posts the balanced AR journal to the General Ledger or flags `BLOCKED_PERIOD_NOT_OPEN` according to `closed_period_policy`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/approve_ar_invoice","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"invoice_id":{"type":"string"},"invoice_number":{"type":"string","description":"e.g. \"INV-0168\""},"post_to_gl":{"type":"boolean"},"closed_period_policy":{"type":"string","enum":["FLAG_PENDING","ERROR","SWEEP_TO_OPEN_PERIOD","OPEN_PERIOD_IF_NEVER_OPENED"]},"target_open_period_name":{"type":"string"}}}},{"name":"post_ar_invoices_to_gl","title":"Run AR -> GL Posting Process & Closed-Period Sweep (v2.0.0)","description":"Run the Accounts Receivable -> General Ledger Posting Process (`post_ar_invoices_to_gl`). Sweeps all approved (`AWAITING_PAYMENT`, `PARTIALLY_PAID`, `PAID`) unposted AR invoices (`gl_posted_flag = false`), validates GL period status (`OPEN` vs `CLOSED` / `NEVER_OPENED`), posts balanced double-entry journals (Debit `1200 Accounts Receivable Control`, Credit Line Revenue accounts, Credit `2100 GST/Tax Payable Control`), updates `gl_balances`, and sets `gl_posted_flag = true` & `gl_posting_status = \"POSTED\"`.","rest_action_url":"https://mcp.henda.ai/v1/gpt/post_ar_invoices_to_gl","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"invoice_ids":{"type":"array","items":{"type":"string"}},"invoice_numbers":{"type":"array","items":{"type":"string"}},"closed_period_policy":{"type":"string","enum":["SKIP_AND_FLAG","ERROR","SWEEP_TO_OPEN_PERIOD","OPEN_PERIOD_IF_NEVER_OPENED"]},"target_open_period_name":{"type":"string","description":"e.g. \"OCT-26\""}}}},{"name":"record_ar_payment","title":"Record Customer Payment Against AR Invoice (v2.0.0)","description":"Record a customer payment against an approved AR Invoice (`ar_payments`): posts a balanced Cash Receipt journal to the General Ledger (Debit `1010 Operating Cash at Bank`, Credit `1200 Accounts Receivable Control`) and updates `amount_paid_minor`, `amount_due_minor`, and `status` (`PARTIALLY_PAID` or `PAID`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/record_ar_payment","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"invoice_id":{"type":"string"},"invoice_number":{"type":"string"},"payment_date":{"type":"string","description":"YYYY-MM-DD"},"amount":{"type":"number","description":"Payment amount in major currency units"},"bank_account_code":{"type":"string","description":"Default \"1010\""},"reference":{"type":"string"}}}},{"name":"void_ar_invoice","title":"Void AR Invoice & Reverse GL Journal (v2.0.0)","description":"Void an unpaid AR Invoice (`status = \"VOIDED\"`). If the invoice was already posted to the General Ledger (`gl_posted_flag = true`), automatically reverses its GL journal entry.","rest_action_url":"https://mcp.henda.ai/v1/gpt/void_ar_invoice","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"invoice_id":{"type":"string"},"invoice_number":{"type":"string"},"reversal_effective_date":{"type":"string"}}}},{"name":"list_ar_invoice_layouts","title":"List AI-Customizable AR Invoice Layouts & Branding Themes (v2.0.0)","description":"List all AI-customizable AR Invoice Layouts & Branding Themes (`ar_invoice_layouts`) for a Set of Books (`sob_id`), including their color palette, typography, header style, embedded logo (`logo_data_uri`), custom HTML/CSS template (`template_mode`), and counts of assigned customers & invoices.","rest_action_url":"https://mcp.henda.ai/v1/gpt/list_ar_invoice_layouts","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"}}}},{"name":"get_ar_invoice_layout","title":"Get AR Invoice Layout / Export Portable .henda-layout.json (v2.0.0)","description":"Retrieve a single AR Invoice Layout (`ar_invoice_layouts`) by `layout_id` or `layout_code` along with a portable `.henda-layout.json` export bundle.","rest_action_url":"https://mcp.henda.ai/v1/gpt/get_ar_invoice_layout","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"layout_id":{"type":"string"},"layout_code":{"type":"string","description":"e.g. \"DEFAULT_CORPORATE\", \"MODERN_SAAS\", \"EXECUTIVE_ADVISORY\""}}}},{"name":"upsert_ar_invoice_layout","title":"Create or Modify AI-Customizable AR Invoice Layout & Branding Theme (v2.0.0)","description":"Create or update an AI-Customizable AR Invoice Layout / Branding Theme (`ar_invoice_layouts`) for a Set of Books (`sob_id`). Allows ChatGPT, Claude, or a remote AR developer to create or modify invoice styles by speaking to the AI or uploading a logo (`logo_data_uri`), customizing colors (`primary_color`, `accent_color`, `table_header_bg`, `table_header_text`), `header_style` (`CLASSIC_SPLIT` | `MODERN_BANNER` | `MINIMAL_CLEAN` | `BOLD_ACCENT_BAR`), column visibility, EFT bank remittance details, or full Mustache/Handlebars `custom_html_template` + `custom_css`.","rest_action_url":"https://mcp.henda.ai/v1/gpt/upsert_ar_invoice_layout","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"layout_id":{"type":"string"},"layout_code":{"type":"string","description":"Unique code e.g. \"MODERN_SAAS\" or \"ACME_BRAND\""},"name":{"type":"string","description":"Display name of the invoice layout"},"description":{"type":"string"},"is_default":{"type":"boolean","description":"If true, sets this layout as the Set of Books default invoice layout"},"template_mode":{"type":"string","enum":["THEME_TOKENS","CUSTOM_HTML"]},"logo_data_uri":{"type":"string","description":"Base64 Data URI (data:image/png;base64,...), SVG Data URI, or HTTPS URL for the company logo"},"theme_config":{"type":"object","properties":{"primary_color":{"type":"string"},"accent_color":{"type":"string"},"table_header_bg":{"type":"string"},"table_header_text":{"type":"string"},"font_family":{"type":"string"},"header_style":{"type":"string","enum":["CLASSIC_SPLIT","MODERN_BANNER","MINIMAL_CLEAN","BOLD_ACCENT_BAR"]},"logo_position":{"type":"string","enum":["LEFT","RIGHT"]},"logo_height_px":{"type":"number"},"document_title":{"type":"string"},"show_tax_number_abn":{"type":"boolean"},"show_company_address":{"type":"boolean"},"show_item_code_column":{"type":"boolean"},"show_discount_column":{"type":"boolean"},"show_tax_column":{"type":"boolean"},"show_division_column":{"type":"boolean"},"show_remittance_slip":{"type":"boolean"},"company_display_name":{"type":"string"},"company_abn":{"type":"string"},"company_address":{"type":"string"},"company_email":{"type":"string"},"company_phone":{"type":"string"},"payment_bank_name":{"type":"string"},"payment_bsb":{"type":"string"},"payment_account_number":{"type":"string"},"payment_account_name":{"type":"string"},"payment_instructions":{"type":"string"},"footer_notes":{"type":"string"}}},"custom_html_template":{"type":"string"},"custom_css":{"type":"string"},"ai_prompt_history":{"type":"string"}},"required":["name"]}},{"name":"delete_ar_invoice_layout","title":"Delete Custom AR Invoice Layout (v2.0.0)","description":"Delete a non-system AR Invoice Layout (`ar_invoice_layouts`) by `layout_id` or `layout_code`.","rest_action_url":"https://mcp.henda.ai/v1/gpt/delete_ar_invoice_layout","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"layout_id":{"type":"string"},"layout_code":{"type":"string"}}}},{"name":"render_ar_invoice_html","title":"Render AR Invoice to Styled Printable HTML Document (v2.0.0)","description":"Render an AR Invoice (or sample preview) into a complete standalone HTML/CSS printable document (`html_document`) using the cascading Invoice Layout resolution: Per-Invoice override (`ar_invoices.invoice_layout_id`) -> Per-Customer default (`ar_contacts.default_invoice_layout_id`) -> Set of Books default (`ar_subledger_settings.default_invoice_layout_id`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/render_ar_invoice_html","inputSchema":{"type":"object","properties":{"sob_id":{"type":"number","description":"Set of Books ID (default 1)"},"invoice_id":{"type":"string"},"invoice_number":{"type":"string","description":"Optional invoice number e.g. \"INV-0168\". If omitted, renders the latest invoice."},"layout_id":{"type":"string"},"layout_code":{"type":"string","description":"Optional layout code override e.g. \"MODERN_SAAS\" or \"EXECUTIVE_ADVISORY\""}}}},{"name":"execute_graphql","title":"Execute Compound Graph Query & Mutation (GraphQL Engine) (v2.0.0)","description":"Execute TwentyCRM-style GraphQL compound queries and plural batch mutations in a single fast call (`POST /graphql`). Supports introspection (`__schema`), compound queries (`glLedgers`, `glCoaSegments`, `coaStructure`, `glAccounts`, `glSegmentValues`, `glPeriods`, `glBudgets`, `trialBalance`, `pnl`, `balanceSheet`, `accountantBrain`, `arSetup`, `arTaxRates`, `arContacts`, `arProducts`, `arInvoices`, `arInvoiceLayouts`, `bankAccounts`, `bankReconciliation`, `glWandBatchBalances`, `glWandBatchDescriptions`), and plural batch mutations (`createGlLedgers`, `createGlAccounts`, `updateGlAccounts`, `createGlSegmentValues`, `updateGlSegmentValues`, `deleteGlAccounts`, `manageGlPeriods`, `createGlJournals`, `createGlBudgets`, `injectGlBudgetBalances`, `configureArSetup`, `upsertArTaxRates`, `upsertArContacts`, `upsertArProducts`, `createArInvoices`, `approveArInvoices`, `postArInvoicesToGl`, `recordArPayments`, `upsertArInvoiceLayouts`, `upsertBankAccounts`, `importBankStatement`, `processBankStatement`, `resolveBankStatementLines`, `executeGraphBatch`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/execute_graphql","inputSchema":{"type":"object","properties":{"query":{"type":"string","description":"GraphQL query or mutation string, e.g. \"query($sobId: Int, $periodName: String) { glCoaSegments(sobId: $sobId) glAccounts(sobId: $sobId) trialBalance(sobId: $sobId, periodName: $periodName) pnl(sobId: $sobId, periodName: $periodName) }\""},"variables":{"type":"object","description":"Variables object (e.g. { sobId: 1, periodName: \"OCT-26\", accounts: [...], journals: [...], balanceQueries: [...] })"},"sob_id":{"type":["number","string"],"description":"Set of Books ID (default 1)"}},"required":["query"]}},{"name":"execute_rest_batch","title":"Execute TwentyCRM-Compatible REST Batch Mutation (v2.0.0)","description":"Execute a TwentyCRM-compatible REST Batch mutation (`POST /rest/batch/:objectName`) to bulk-create or upsert records in a single call. Supported `object_name` values: `glAccounts`, `glSegmentValues`, `glLedgers`, `glJournals`, `glBudgets`, `glBudgetBalances`, `glBudgetJournals`, `arContacts`, `arProducts`, `arTaxRates`, `arInvoices`, `arInvoiceLayouts`, `ceBankAccounts`.","rest_action_url":"https://mcp.henda.ai/v1/gpt/execute_rest_batch","inputSchema":{"type":"object","properties":{"object_name":{"type":"string","enum":["glAccounts","glSegmentValues","glLedgers","glJournals","glBudgets","glBudgetBalances","glBudgetJournals","arContacts","arProducts","arTaxRates","arInvoices","arInvoiceLayouts","ceBankAccounts"],"description":"Target ERP object collection to batch-create/upsert"},"sob_id":{"type":["number","string"],"description":"Set of Books ID (default 1)"},"data":{"type":"array","items":{"type":"object"},"description":"Array of records to batch-create/upsert"},"budget_name":{"type":"string","description":"Optional budget version name when object_name is glBudgetBalances or glBudgetJournals"},"mode":{"type":"string","enum":["REPLACE","ADD"],"description":"Optional mode when object_name is glBudgetBalances"}},"required":["object_name","data"]}},{"name":"evaluate_gl_wand_batch","title":"Evaluate Batch of Henda Excel Add-in =Get_Balance & Description Formulas In-Memory (v2.0.0)","description":"Vectorized Henda Excel Add-in Formula Batch Evaluator: evaluates dozens or hundreds of `=Get_Balance(...)` (`balance_queries`) and `=Segment_Description(...)` (`description_queries`) formulas in a single in-memory snapshot pass (`<2ms`). Ideal when building financial models, multi-period matrices, or multi-book consolidations.","rest_action_url":"https://mcp.henda.ai/v1/gpt/evaluate_gl_wand_batch","inputSchema":{"type":"object","properties":{"balance_queries":{"type":"array","description":"Array of Henda Excel Add-in Get_Balance formula queries to evaluate against the single preloaded snapshot","items":{"type":"object","properties":{"key":{"type":"string","description":"Optional caller correlation key (e.g. cell reference \"D12\")"},"sob_id":{"type":["number","string"],"description":"Set of Books ID (1, 2, 3...) or \"%\" for consolidated multi-book rollup"},"period_name":{"type":"string","description":"Fiscal period e.g. \"OCT-26\""},"balance_type":{"type":"string","enum":["YTD","PTD","QTD","YTD_NATURAL","PTD_NATURAL"]},"currency_code":{"type":"string"},"actual_flag":{"type":"string","enum":["A","B"]},"budget_name":{"type":"string","description":"Budget version name when actual_flag=\"B\""},"segments":{"type":"array","items":{"type":"string"},"description":"Segment filter array [seg1, seg2, seg3, ...] supporting wildcards (\"%\", \"*\"), ranges (\"4000-4999\"), lists (\"1010,1200\"), and parent summary codes (\"4000\")"}}}},"description_queries":{"type":"array","description":"Optional array of =Segment_Description(code, seg_num) lookups","items":{"type":"object","properties":{"key":{"type":"string"},"sob_id":{"type":["number","string"]},"seg_num":{"type":"number","description":"Segment number 1..10 (default 2)"},"code":{"type":"string","description":"Account or segment code/expression e.g. \"4010\", \"4000\", \"5000-5999\""}},"required":["code"]}}}}},{"name":"expand_segment_hierarchy","title":"Expand Parent Rollup / Segment Hierarchy Tree (1..10 Segments) (v2.0.0)","description":"Expand a Parent Summary Account (e.g. \"1000\", \"4000\", \"5000\", \"6000\"), Range (\"4000-4999\"), List (\"1010,1200\"), or Wildcard (\"%\") into its postable child segment values (mirrors the Henda Excel Add-in Expand function and Web Console hierarchy view).","rest_action_url":"https://mcp.henda.ai/v1/gpt/expand_segment_hierarchy","inputSchema":{"type":"object","properties":{"sob_id":{"type":["number","string"],"description":"Set of Books ID (default 1)"},"segment_num":{"type":"number","description":"Segment number 1..10 (1=Company, 2=Natural Account, 3=Cost Center, 4..10=Custom)"},"expression":{"type":"string","description":"Parent summary code (e.g. \"4000\"), range (\"5000-5999\"), list (\"1010,1200\"), or wildcard (\"%\")"}},"required":["expression"]}},{"name":"resolve_code_combination","title":"Validate & Resolve Dynamic Code Combination (CCID) (1..10 Segments) (v2.0.0)","description":"Validate and resolve (or dynamically create) a Chart of Accounts Code Combination (`gl_code_combinations.ccid`) for a Set of Books (`sob_id`), verifying that every segment value exists, is active, and is postable (`allow_posting = true`, `is_summary = false`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/resolve_code_combination","inputSchema":{"type":"object","properties":{"sob_id":{"type":["number","string"],"description":"Set of Books ID (default 1)"},"concatenated_code":{"type":"string","description":"Full segment combination separated by \"-\" (e.g. \"01-4010-300\" or \"04-4010-100-001-01\")"}},"required":["concatenated_code"]}},{"name":"manage_tenants_and_api_keys","title":"Manage Multi-Tenant Workspaces & User-Level Access Tokens (v2.0.0)","description":"Manage Multi-Tenant Workspaces & User-Level Personal Access Tokens (`henda_live_...`): list registered tenants (`list_tenants`), register & onboard a new tenant workspace with founding ORG_ADMIN user, optional initial Set of Books, and Resend welcome email (`register_tenant`), list access tokens (`list_api_keys`), generate a new user-scoped Personal Access Token (`create_api_key`), verify a raw token (`verify_token`), or revoke a token (`revoke_api_key`).","rest_action_url":"https://mcp.henda.ai/v1/gpt/manage_tenants_and_api_keys","inputSchema":{"type":"object","properties":{"action":{"type":"string","enum":["list_tenants","register_tenant","list_api_keys","create_api_key","revoke_api_key","verify_token"],"description":"Action to perform (default \"list_tenants\")"},"tenant_id":{"type":"string"},"user_id":{"type":"string","description":"Owner user UUID when creating or listing user-level tokens"},"user_email":{"type":"string","description":"Owner user email when creating or listing user-level tokens"},"organization_name":{"type":"string","description":"Required when action=\"register_tenant\""},"slug":{"type":"string"},"admin_email":{"type":"string","description":"Required when action=\"register_tenant\""},"admin_name":{"type":"string"},"admin_password":{"type":"string"},"initial_set_of_books":{"type":"object","description":"Optional Set of Books specification to provision during register_tenant"},"name":{"type":"string","description":"Personal Access Token label when action=\"create_api_key\""},"allowed_sob_ids":{"type":["string","array"],"description":"Allowed Set of Books IDs (or \"*\") when action=\"create_api_key\""},"scopes":{"type":"array","items":{"type":"string"}},"expires_in_days":{"type":["number","null"]},"key_id":{"type":"string","description":"Token ID to revoke when action=\"revoke_api_key\""},"raw_api_key":{"type":"string","description":"Raw Bearer token (henda_live_...) when action=\"verify_token\""}}}},{"name":"get_api_and_graph_discovery","title":"Get Full REST, GraphQL & MCP Graph Discovery Catalog (v2.0.0)","description":"Retrieve the machine-readable Henda API, GraphQL, Batch & Strict ERP Invariants Discovery Catalog (`GET /v1/discovery`), including all Graph tools, GraphQL queries & plural mutations, REST batch object names, and active Sets of Books.","rest_action_url":"https://mcp.henda.ai/v1/gpt/get_api_and_graph_discovery","inputSchema":{"type":"object","properties":{}}}]}