Inventory Forecast
inventory_forecastPredict stock depletion dates using moving-average sales velocity. Get reorder points, safety stock levels, and suggested reorder quantities for each product.
Instructions
Predict stock depletion dates using moving-average sales velocity. Returns reorder points, safety stock levels, and suggested reorder quantities for each product.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| store_id | Yes | UUID of a connected store (returned by store_connect with action="connect" or visible in store_connect with action="list" / the store_overview resource) | |
| product_id | No | Restrict the forecast to a single product by its external_id (Shopify product ID or WooCommerce product slug). Omit to forecast every active product in the store. |
Implementation Reference
- src/models/store.ts:131-146 (schema)Type definition (ForecastResult) used by the inventory_forecast tool. Defines all output fields: product_id, product_title, sku, current_stock, avg_daily_sales, days_of_stock, depletion_date, reorder_point, suggested_reorder_qty, safety_stock, risk_level, and detail.
// ── Inventory Forecast ──────────────────────────────────────────── export const ForecastResultSchema = z.object({ product_id: z.string(), product_title: z.string(), sku: z.string().nullable(), current_stock: z.number().int(), avg_daily_sales: z.number(), days_of_stock: z.number().nullable(), depletion_date: z.string().nullable(), reorder_point: z.number().int(), suggested_reorder_qty: z.number().int(), safety_stock: z.number().int(), risk_level: z.enum(['low', 'medium', 'high', 'critical']), detail: z.string(), }); export type ForecastResult = z.infer<typeof ForecastResultSchema>;