Method

lot.update

Set a lot's title or notes; an empty string removes one.

Sets a lot's title or notes; a field you leave out is kept and an empty string removes it. GnuCash's lot viewer writes empty strings whenever you move the selection; this writes only what you give.

Examples

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

JSON-RPC

Request:

{"jsonrpc":"2.0","id":1,"method":"lot.update","params":{"lot":"10000000000000000000000000000000","title":"Core holding","notes":"bought at open"}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "guid": "10000000000000000000000000000000",
    "title": "Core holding",
    "notes": "bought at open",
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash lot.update '{"lot":"10000000000000000000000000000000","title":"Core holding","notes":"bought at open"}'

It prints:

{
  "guid": "10000000000000000000000000000000",
  "title": "Core holding",
  "notes": "bought at open",
  "…": "…"
}

MCP tool call

Tool call:

{"name":"lot.update","arguments":{"lot":"10000000000000000000000000000000","title":"Core holding","notes":"bought at open"}}

Result:

{
  "structuredContent": {
    "guid": "10000000000000000000000000000000",
    "title": "Core holding",
    "notes": "bought at open",
    "…": "…"
  }
}

Effect: write, on the Book.

Params

Params of lot.update.

  • lot (Guid, required): The lot.
  • title (string or null): New title; an empty string removes it.
  • notes (string or null): New notes; an empty string removes them.

Result

A lot, as the lot viewer lists it.

  • guid (Guid, required): The lot.
  • account (Guid, required): Its account.
  • title (string or null): Title.
  • notes (string or null): Notes.
  • invoice (Guid or null): The invoice the lot belongs to (the viewer's type I).
  • closed (boolean, required): The lot has splits and its balance is zero.
  • openDate (Date or null): Posted date of its earliest split.
  • closeDate (Date or null): Posted date of its latest split, when closed.
  • balance (Amount, required): Sum of its splits' amounts, restated after stock splits.
  • gainsCurrency (CommodityId or null): Currency of its realised gains.
  • realizedGains (Amount, required): Realised gains: the values of its gains splits in that currency.
  • splitCount (integer (uint), required): How many splits it holds.