Correct stock
dolibarr_stock_correctRecords a manual stock correction in one warehouse: positive quantities add stock, negative quantities remove it. Preview mode shows changes first; confirm only after explicit approval.
Instructions
Books a manual stock correction in one warehouse: a positive qty adds stock, a negative qty removes it. For inventory corrections only; goods received, shipped, produced or consumed should go through receptions, shipments and manufacturing orders. This step cannot simply be undone: without confirm=true it only returns a preview.
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": {
"product_id": "<product_id>",
"qty": "<qty>",
"label": "<label>",
"warehouse_id": "<warehouse_id>"
},
"name": "dolibarr_stock_correct"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lot | No | Lot or serial number; required for lot-tracked products. | |
| qty | Yes | Positive to add stock, negative to remove it (base unit). | |
| eatby | No | Best-before date, only when this creates a new lot. | |
| label | Yes | Why: shown in the stock movement journal. | |
| reason | No | One line on why, kept in the audit log. Required when confirm is true. | |
| sellby | No | Sell-by date, only when this creates a new lot. | |
| confirm | No | false (default) = change nothing, only show what would happen. true = do it. Set true only after the user has explicitly agreed to this exact step. | |
| unit_cost | No | Unit cost of added stock, to update the weighted average cost. | |
| product_id | Yes | ||
| warehouse_id | Yes |