Edit a shopping item
shopping_updateRename a shopping item or change or clear its quantity to fix typos or wrong amounts, using optimistic locking so concurrent edits are never overwritten.
Instructions
Rename a shopping item or change or clear its quantity, for example to fix a typo or a wrong amount, keeping its id, adder and bought state. Any member may do it. Send only the fields to change, at least one of name and quantity. To tick an item off or reopen it use shopping_set_bought; 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. Renaming to the name of another open item fails with 409 shopping_item_duplicate. Nobody is notified. 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>",
"expectedUpdatedAt": "<expectedUpdatedAt>",
"expectedBoughtAt": "<expectedBoughtAt>"
},
"name": "shopping_update"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Id of the shopping item, from shopping_list. | |
| name | No | New item name. Omit to keep the current one. | |
| wgCode | No | Share code of the flat (code from wg_list). Leave it out when the account belongs to one flat. | |
| quantity | No | New free-text amount, for example "2" or "1 kg". Send null or an empty string to clear it. Omit to keep the current one. | |
| 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. |