Method

account.move

Move an account, with its sub-accounts, under another parent.

Moves an account, with its sub-accounts, under another parent as that parent's last child. The new parent's type must allow the account's type, the parent must not be inside the moved subtree, and no sibling there may have the same name. Transactions are untouched: they follow the account.

Examples

Example: with a copy of the reports/test-data example book open as book.gnucash.

JSON-RPC

Request:

{"jsonrpc":"2.0","id":1,"method":"account.move","params":{"account":"Root:Asset:Wallet","parent":"Root:Asset:Bank"}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "name": "Wallet",
    "fullName": "Root:Asset:Bank:Wallet",
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash account.move '{"account":"Root:Asset:Wallet","parent":"Root:Asset:Bank"}'

It prints:

{
  "name": "Wallet",
  "fullName": "Root:Asset:Bank:Wallet",
  "…": "…"
}

MCP tool call

Tool call:

{"name":"account.move","arguments":{"account":"Root:Asset:Wallet","parent":"Root:Asset:Bank"}}

Result:

{
  "structuredContent": {
    "name": "Wallet",
    "fullName": "Root:Asset:Bank:Wallet",
    "…": "…"
  }
}

Effect: write, on the Book.

Params

Params of account.move.

  • account (AccountRef, required): The account to move, with its sub-accounts.
  • parent (AccountRef, required): The new parent; it becomes the last of the parent's children.

Result

An account.

  • guid (Guid, required): GUID.
  • name (string, required): Name.
  • fullName (string, required): Full name: ancestors' names joined by :, without the root.
  • type (string, required): Account type, as GnuCash writes it.
  • parent (Guid or null): Parent; none only for the root.
  • commodity (CommodityId or null): Commodity held.
  • scu (integer (int64), required): Smallest fraction the account's amounts are kept in.
  • nonStandardScu (boolean, required): The smallest fraction was chosen instead of the commodity's.
  • code (string or null): Account code.
  • description (string or null): Description.
  • notes (string or null): Notes.
  • placeholder (boolean, required): Groups other accounts; GnuCash's register refuses splits in it.
  • hidden (boolean, required): Hidden itself.
  • hiddenInTree (boolean, required): Hidden itself or through an ancestor, as GnuCash shows it.
  • taxRelated (boolean, required): Tax-related.
  • taxUs (TaxUs, required): US tax (TXF) settings.
  • depth (integer (uint), required): Levels below the root (top-level accounts are 1).
  • children (integer (uint), required): Number of immediate sub-accounts.
  • hasSplits (boolean, required): The account has splits.
  • color (string or null): Account colour (rgb(r,g,b) as GnuCash's dialog writes it, or as stored); null when unset or Not Set.
  • higherBalanceLimit (Amount or null): Higher balance limit, in raw sign (debits positive).
  • lowerBalanceLimit (Amount or null): Lower balance limit, in raw sign.
  • includeSubaccountBalances (boolean, required): The balance limits apply to the balance with sub-accounts.
  • openingBalance (boolean, required): The EQUITY account holding the opening balances of its commodity.
  • associatedAccounts (map of Guid, required): Associated accounts by tag (such as stock-dividends), each naming an existing account.