Method

employee.update

Change an employee; `active: false` deactivates it.

Changes the fields of an employee you name; fields you leave out stay as they are, and null clears creditCardAccount. Employees cannot be deleted; set active: false.

Examples

Example: with a copy of the synthetic/business-editable example book open as book.gnucash.

JSON-RPC

Request:

{"jsonrpc":"2.0","id":1,"method":"employee.update","params":{"employee":"7f0d801fdccd48198abec7b197e55581","rate":"45.00"}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "guid": "7f0d801fdccd48198abec7b197e55581",
    "rate": {
      "num": "4500",
      "denom": "100"
    },
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash employee.update '{"employee":"7f0d801fdccd48198abec7b197e55581","rate":"45.00"}'

It prints:

{
  "guid": "7f0d801fdccd48198abec7b197e55581",
  "rate": {
    "num": "4500",
    "denom": "100"
  },
  "…": "…"
}

MCP tool call

Tool call:

{"name":"employee.update","arguments":{"employee":"7f0d801fdccd48198abec7b197e55581","rate":"45.00"}}

Result:

{
  "structuredContent": {
    "guid": "7f0d801fdccd48198abec7b197e55581",
    "rate": {
      "num": "4500",
      "denom": "100"
    },
    "…": "…"
  }
}

Effect: write, on the Book.

Params

Params of employee.update: the fields to change.

  • employee (Guid, required): The employee.
  • name (string or null): The employee's name, which GnuCash keeps as the address name; it overrides addr.name.
  • id (string or null): Employee number. On create, absent or empty takes the next number from the book's gncEmployee counter.
  • username (string or null): User name.
  • currency (CommodityId or null): The currency of the employee's expense vouchers.
  • addr (AddressParams or null): Payment address.
  • language (string or null): Language.
  • acl (string or null): Access control list (stored only).
  • workday (Amount or null): Working hours per day.
  • rate (Amount or null): Hourly rate.
  • creditCardAccount (AccountRef or null): The company credit card account (type CREDIT) card-paid expenses are charged to; null for none.
  • active (boolean or null): Active; false deactivates.

Result

An employee.

  • guid (Guid, required): A GUID: 32 hexadecimal digits.
  • id (string, required)
  • name (string, required): The address name.
  • username (string, required)
  • addr (AddressInfo, required): An address. Empty strings are unset fields.
  • language (string, required)
  • acl (string, required)
  • workday (Amount, required): An exact amount. Read from a decimal string ("12.34"), a rational string ("1234/100") or {num, denom} with string members; written as {num, denom}. Never a JSON number.
  • rate (Amount, required): An exact amount. Read from a decimal string ("12.34"), a rational string ("1234/100") or {num, denom} with string members; written as {num, denom}. Never a JSON number.
  • currency (CommodityId or null)
  • creditCardAccount (Guid or null)
  • active (boolean, required)