Revalue Stock Cost
revalue_stock_costCorrect the unit cost of stock that is already on hand, without moving any units: for stock that came in without a receipt (a direct add with adjust_stock, a stock-level set, an import) at the wrong cost. Re-values that stock to the cost it should have come in at; units already sold or removed from it are re-valued too, on the account they left through. A connected ledger gets one correction journal set against Inventory Adjustment. Does not change the item's catalog cost (upsert_items does that, and it only values stock that came in at $0). Stock received on a purchase order's delivery receipt is refused: correct its cost on that receipt in the app. Each call re-values one cost layer of one item; when the item has more than one eligible layer, the refusal lists them and costLayerId picks one. Two-step: preview=true, then repeat the identical call with the previewReceipt and a fresh idempotencyKey. Requires Write + inventory.execute.
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": "<item>",
"unitCost": "<unitCost>",
"reason": "<reason>"
},
"name": "revalue_stock_cost"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item | Yes | Item id (GUID) or SKU whose stock to re-value. | |
| reason | Yes | Why the cost is being corrected (e.g. "Landed cost corrected from supplier invoice"), up to 500 characters. Kept on the correction record. | |
| preview | No | Step 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing changes until the commit call. | |
| unitCost | Yes | The unit cost the stock should carry, in the account's currency (e.g. 0.2427). Must differ from the cost it carries now. | |
| costLayerId | No | Optional: the cost layer (GUID) to re-value, when the item holds more than one eligible layer. Omit it when the item has exactly one. | |
| idempotencyKey | No | Caller-generated idempotency key; required with previewReceipt to commit. | |
| previewReceipt | No | Step 2 of the required two-step write: the receipt returned by the preview call. Supply together with a fresh idempotencyKey to commit; calls without it are refused. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| effects | No | ||
| preview | No | ||
| nextStep | No | ||
| expiresAt | No | ||
| revaluation | No | ||
| actionItemId | No | ||
| confirmation | No | ||
| correlationId | No | ||
| approvalResult | No | ||
| idempotencyKey | No | ||
| previewReceipt | No | ||
| idempotentReplay | No |