Mark an item as bought
shopping_set_boughtMark an open shopping item as bought or reopen it. Uses optimistic locking; pass the item's updatedAt and boughtAt from shopping_list to prevent concurrent edits.
Instructions
Mark one open item as bought, or put a bought item back on the open list (bought=false). Any member may do it. It only changes the bought state: to rename the item or change its quantity use shopping_update, and to delete it use shopping_remove. Uses optimistic locking: call shopping_list first and pass the item's updatedAt and boughtAt unchanged. If someone changed the item in between, the call fails with 409 shopping_item_changed and nothing is written: read the list again and decide again. If the item is already in the requested state the call succeeds without changes. Marking as bought records the caller as boughtBy and sets boughtAt to now; reopening clears both. Reopening can fail with 409 shopping_item_duplicate when another open item has the same name. Returns the updated item; item_not_found for an unknown id.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>",
"bought": "<bought>",
"expectedUpdatedAt": "<expectedUpdatedAt>",
"expectedBoughtAt": "<expectedBoughtAt>"
},
"name": "shopping_set_bought"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Id of the shopping item, from shopping_list. | |
| bought | Yes | true marks the item as bought by the caller; false reopens a bought item. | |
| wgCode | No | Share code of the flat (code from wg_list). Leave it out when the account belongs to one flat. | |
| expectedBoughtAt | Yes | The item's boughtAt exactly as returned by shopping_list, or null if it is still open. Guards against concurrent edits. | |
| expectedUpdatedAt | Yes | The item's updatedAt exactly as returned by shopping_list (ISO 8601 with offset). Guards against concurrent edits. |