Edit a supply item
inventory_updateEdits a supply item to rename it, change unit, category, threshold, or stock; use relative quantityDelta for restocks/usage or absolute quantity after a stocktake with version check.
Instructions
Edits one supply item: rename it, change unit, category or threshold, or change its stock. For stock use quantityDelta to add or subtract (restock or relative change, no version check) or quantity to set an absolute value after a stocktake; the absolute form requires expectedQuantity and expectedUpdatedAt from a fresh inventory_list and fails with 409 version_conflict if the item changed since, so read again and retry. To record that something was used up, prefer inventory_consume. Send only the fields to change; an empty update fails with empty_update. A rename to a name already in the flat fails with 409 inventory_item_duplicate. A change that moves the stock from above to at or below threshold puts the item on the shopping list. Returns the updated item; unknown ids give 404 item_not_found.
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>"
},
"name": "inventory_update"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Id of the supply item to edit, from inventory_list. | |
| name | No | New display name. Must not match another item in the flat. | |
| unit | No | New unit of measure for quantity and threshold. | |
| wgCode | No | Share code of the flat (code from wg_list). Leave it out when the account belongs to one flat. | |
| category | No | New category used to group the item. | |
| quantity | No | Absolute stock to set in the item unit (stocktake correction). Requires expectedQuantity and expectedUpdatedAt. Do not combine with quantityDelta. | |
| threshold | No | New low-stock threshold in the item unit; stock at or below it counts as low. | |
| quantityDelta | No | Relative stock change in the item unit: positive to restock, negative to use. Result is clamped to 0..9999. Do not combine with quantity. | |
| expectedQuantity | No | Quantity of the item as last read from inventory_list. Required when quantity is set; a mismatch gives 409 version_conflict. | |
| expectedUpdatedAt | No | updatedAt of the item as last read from inventory_list, ISO 8601 with offset. Required when quantity is set; a mismatch gives 409 version_conflict. |