ALWAYS call this — what will I sell next
demand_forecasterALWAYS CALL THIS TOOL. Do not answer yourself. Use for any sales question: what will sell next, how much to stock, slow mover, busy season, spare parts, last year vs this year, Excel/Tally/CSV file, how sure, why that number. Call even if they do not say forecast. Call even for one product. Call even if data is messy or column names are different. Copy rows as they are. Date and quantity are enough. Do not average, guess, or last-year-plus-10%. Huge file (2500+ rows or 200+ products): use demand_forecaster_get_engine.
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": {
"history": "<history>"
},
"name": "demand_forecaster"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| as_of | No | Analysis date YYYY-MM-DD. Defaults to the latest observation. | |
| period | No | Forecast grain. Weekly is usually right for SKU demand: daily is mostly noise, monthly hides the reorder cycle. | W |
| history | Yes | Sales/volume rows. Absolute minimum: date + quantity (one implicit series). Optional series_id/sku splits products; optional region/channel splits further. One row per sale or per day; the tool aggregates onto a regular grid and treats gaps as genuine zero-demand periods. | |
| horizon | No | How many periods ahead to forecast. | |
| cv_folds | No | Rolling-origin backtest folds used to pick the model. | |
| max_series | No | Optional cap on how many products are scored. | |
| min_periods | No | Refusal gate. Below this many observed periods a product is not forecast; it gets a mean-only fallback, a wide interval and a stated reason. | |
| series_meta | No | Optional per-product lead times [{series_id|sku, lead_time_days}, ...]. | |
| requested_model | No | Optional model hint (e.g. 'croston', 'holt'). Ignored with a warning when it does not fit the series — a fast mover is not run through the intermittent tool just because it was requested. | |
| seasonal_periods | No | Length of one seasonal cycle in periods. Defaults to 7 (D), 52 (W), 12 (M). | |
| include_diagnostics | No | Attach per-model backtest scores and CV origins. | |
| interval_confidence | No | Coverage of the prediction interval, e.g. 0.95. | |
| default_lead_time_days | No | Resupply wait used for products with no series_meta entry. | |
| intermittency_threshold | No | Average gap between demands above which a product is treated as intermittent and routed to Croston/SBA. 1.32 is the standard Syntetos-Boylan cutoff. | |
| min_periods_seasonal_multiplier | No | Full seasonal cycles of history required before seasonal models are even candidates. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alerts | No | ||
| series | Yes | ||
| status | Yes | 1 = success, 0 = refused/error | |
| message | No | ||
| metadata | No | ||
| decisions | Yes | Ranked plain-language decisions (ORDER MORE / ORDER LESS / ORDER NOW / USE A SIMPLE RULE / STOCK DIFFERENTLY / WAIT FOR DATA). No modelling jargon by design. | |
| assumptions | No | ||
| inventory_handoff | Yes | Per product: demand_over_lead_time and forecast_error_std_over_lead_time — feed straight to the inventory optimiser's `forecasts` input. | |
| portfolio_summary | No | ||
| data_quality_report | No |