Size Order To Date
size_order_to_dateHow much of an item to order so stock lasts through a date ("enough to get through Nov 15"). For each item (itemIds and/or skus, max 100) at one warehouse: the daily demand rate (forecast over exactly that window, or recent sales), days from today (tenant calendar) through coverThrough inclusive, demand, safety stock, available, inbound (open POs and transfers expected on or before coverThrough; undated ones count and are reported as inboundUndated; later ones are reported as inboundAfterCover and not counted), and suggestedQuantity = ceil(demand + safety stock - available - inbound), never below zero and raised to the preferred vendor's minimum order quantity. Also returns the preferred vendor and the unit cost a draft PO would use. Read-only: pass the result to create_purchase_order to order it.
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": {
"coverThrough": "<coverThrough>"
},
"name": "size_order_to_date"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| skus | No | Item SKUs. Provide itemIds and/or skus. | |
| itemIds | No | Item ids (GUIDs). Provide itemIds and/or skus. | |
| warehouseId | No | Warehouse id (GUID) to size for — from list_warehouses. Optional when the tenant has one stock-holding warehouse. | |
| coverThrough | Yes | Last day the stock must last through, YYYY-MM-DD on the tenant's calendar. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| items | No | ||
| today | No | ||
| notFound | No | ||
| coverThrough | No |