Adjust stock
adjust_stockCorrect a quantity-tracked item's stock at ONE location: "we used up 12 batteries", "50 arrived", "recounted: there are 7". Exactly one of delta (relative: negative = used up, positive = received) or setTo (absolute recount). kind states the intent (usage | receipt | correction; inferred from the argument shape when absent); reason is a short note for the activity timeline. A negative delta past the location's unreserved stock is rejected (the error names the amounts); a setTo recount always records the count, even below reservations. A restock task opens automatically when a location's AVAILABLE stock (on hand minus what active orders reserved) drops below its threshold, so a location can be low with a full shelf. The result returns every stocked level as distribution: { locationId, name, kind: location|person, quantity, available, reserved?, minStock?, isLow? }, the same row shape check_item_availability returns, so isLow shows whether this adjustment took the location under its threshold. transfer_stock moves stock between locations; serialized items change through assign_item and set_item_status. Requires the manager role. Not idempotent: a repeated delta applies twice (a repeated setTo does not change the count again).
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": {
"itemId": "<itemId>",
"locationId": "<locationId>"
},
"name": "adjust_stock"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Intent for the activity timeline; inferred from the argument shape when absent | |
| delta | No | Relative change: negative = used up, positive = received (exactly one of delta/setTo) | |
| setTo | No | Absolute recount — the new quantity at this location | |
| itemId | Yes | Item id (must be a quantity-tracked item) | |
| reason | No | Short reason, shown in the item's activity timeline | |
| locationId | Yes | Location (or stock-holding person) resource id, from search_resources or check_item_availability's distribution |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Item name | |
| itemId | No | Item id | |
| distribution | No | Every stocked level after the change — the SAME row shape check_item_availability returns | |
| totalQuantity | No | Pool total after the change | |
| newLevelQuantity | No | The adjusted location's stock after the change |