Stock forecast
stock_forecastForecast product stockouts from real sales and calculate days of cover, depletion date, and reorder quantity so you know what to reorder before items run out.
Instructions
Which products run out soon, from real sales: units sold per product in the last days (cancelled orders excluded), the current available stock, the days of cover at that pace, the date the stock reaches zero and a reorder quantity that keeps it in stock through the horizon plus restockDays more days (a negative stock is a backlog and is covered too). Lists the active products whose cover is below horizon days, soonest first. Products without sales in the window are never listed. Use it for 'what do I need to reorder?'. Returns { window, horizon, restockDays, total, items[], notes? }.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "stock_forecast"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Sales window in days | |
| limit | No | ||
| horizon | No | List products that run out within this many days | |
| restockDays | No | Days beyond the horizon the suggested reorder quantity should cover | |
| salesChannelId | No | Count sales of one sales channel only |