set_item_stock_quantity
Set an item's stock quantity to an absolute value, with optimistic locking that requires the current stock to equal the expected quantity, and an optional dry-run to preview before writing.
Instructions
Modifies merchant data. Set an item's stock to an ABSOLUTE quantity (not a delta).
Optimistic lock: refuses unless current stock equals expected_current_quantity. Bounds: 0 <= new_quantity <= 1_000_000. dry_run=True previews the PUT body (still performs one read to fetch current stock) and never writes. Requires INVENTORY_R and INVENTORY_W.
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": {
"item_id": "<item_id>",
"new_quantity": "<new_quantity>",
"expected_current_quantity": "<expected_current_quantity>"
},
"name": "set_item_stock_quantity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | ||
| item_id | Yes | ||
| new_quantity | Yes | ||
| expected_current_quantity | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||