Optimize Lot Size
optimize_lot_sizeFind the lot size with the lowest total cost for a calculation: production cost plus holding cost (capital tie-up and storage), capped at one year of demand. Use it to answer how many parts to make per batch. Returns the optimal lot, the yearly saving of moving there, the cost-versus-quantity curve, an Andler/EOQ cross-check and at most two directions (change the lot size, cut setup time). To price one other lot size exactly, use preview_cost. Read-only and free.
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": {
"calculation_id": "<calculation_id>"
},
"name": "optimize_lot_size"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| calculation_id | Yes | Id of a calculation, as upload_and_quote, quote_part or list_calculations return it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| curve | No | Compact curve points: {quantity, unit_cost, direct_unit_cost (before overhead, setup amortised over that lot), offer_price (the per-unit figure a quote shows), setup_time_s, unit_time_s} — cost AND time vs quantity in one read, when present; money in currency. Exact at exact_at_quantity, indicative elsewhere (see accuracy). | |
| status | Yes | ||
| accuracy | No | How far a curve point may sit from a real run at that quantity, as the API publishes it: {basis, max_deviation_pct, note}. Null on older calculations. | |
| currency | No | Currency every money figure on this result is stated in (the calculation's), the optimum and the curve alike. | |
| guidance | Yes | ||
| scenario | No | The scenario recommended_lot_size states — buyer_stock: the buyer orders in lots and holds the stock. Absent on older calculations. | |
| scenarios | No | Every lot-size scenario's answer on the same curve: buyer_stock, supplier_stock (the supplier produces ahead of a steady call-off and holds the stock, economic production quantity), make_to_order (shipped complete, consumed on delivery — only the supplier's work in progress is held), joint (a frame contract with call-offs, both parties' costs minimised together: the call-off and the supplier's production lot) and consignment (the frame contract with supplier-owned stock at the buyer's site until use — capital at the supplier's production cost on every unit, storage where it sits). Pick the one that is your situation. Empty on older calculations. | |
| annual_volume | No | Annual demand the optimum weighs holding against. | |
| calculation_id | Yes | ||
| andler_lot_size | No | Classic Andler/EOQ closed-form cross-check quantity. | |
| recommendations | No | At most two solid optimization directions; empty when nothing material or the calculation predates the optimum. | |
| valuation_basis | No | How the scenarios value a piece. purchase_price: the buyer pays and holds at the purchase price after the supplier's customer and cash discounts; the supplier holds at production cost including material and production overheads. offer_price: a calculation made before that basis — the buyer at the offer price, the supplier's stock at manufacturing cost; recalculate to restate it. Absent on older calculations. | |
| current_lot_size | No | ||
| current_unit_cost | No | Production cost per piece at the ordered lot, in currency. | |
| exact_at_quantity | No | The lot this calculation was run for: the curve reproduces its price exactly here and is indicative at every other quantity. Null on older calculations. | |
| net_annual_saving | No | Net saving per year of moving to the recommended lot, production plus inventory holding, in currency. | |
| single_lot_demand | No | True when one lot already covers the whole annual demand (annual_volume ≤ current_lot_size). There is then no lot-size trade-off to optimise: the recommendation equals the current lot by construction, not because the lot is economically optimal. annual_volume defaults to 1 when a request omits it — pass the real annual demand to get a recommendation. | |
| recommended_lot_size | No | Total-cost optimal lot (≤ one year of demand). | |
| recommended_unit_cost | No | Production cost per piece at the recommended lot, in currency. | |
| ordering_cost_per_order | No | The buyer's fixed cost per order or delivery (order handling and inbound freight) the buyer-side scenarios weigh against the price breaks (0 where the environment states none), in currency. | |
| inputs_changed_since_run | No | Null when this price reflects every input on its part revision. Otherwise {roles, corrections, latest_at}: files attached and corrections applied to the part after the run read its inputs, which a new calculation reads and this one did not. | |
| production_rate_per_year | No | Pieces the route can make in a year of its machines' run hours — the finite production rate behind the supplier and joint scenarios. Absent where no machine states annual hours. | |
| current_effective_unit_cost | No | The buyer's effective cost per piece at the ordered lot (buyer_stock): the price per piece on the basis valuation_basis names, plus the per-piece ordering and inventory holding cost, in currency. | |
| environment_changed_since_run | No | Null when this price was computed on its costing environment as it stands. Otherwise {latest_at}: the environment was edited after the run read it, and a new calculation prices with the current setup while this result does not. | |
| recommended_effective_unit_cost | No | The buyer's effective cost per piece at the recommended lot (buyer_stock), on the same basis as current_effective_unit_cost, in currency. |