Apply Demand Curve to Items
apply_demand_curve_to_itemsApply one demand curve to a batch of items (max 10,000 ids per call; item ids come from list_items) in a single idempotent action. The ids must belong to the targeted catalog: a client-pinned credential applies to its own client's items, and an operator (unpinned) credential applies to the house catalog unless clientId targets a client's items. Applications are Modulate-only: the mean-normalized shape re-times each item's forecast within the year but cannot change its annual total, which is what makes a catalog-scale application volume-safe — volume-setting (absolute) assignments are deliberately not available over MCP; a person sets volumes in the app. Items already carrying this curve are counted, not duplicated; items carrying a DIFFERENT curve are skipped unless overwriteExisting=true replaces them. Every created assignment is stamped source=McpTool with a sourceRef for provenance, and the response accounts for every requested id (matched/notFound/assigned/alreadyAssigned/replaced/skippedConflict).
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": {
"curveId": "<curveId>",
"itemIds": "<itemIds>"
},
"name": "apply_demand_curve_to_items"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Optional note on how the items were selected (e.g. the filter used) — stored as provenance on each created assignment. | |
| curveId | Yes | The demand curve id (GUID) to apply. | |
| itemIds | Yes | Item ids (GUIDs) to apply it to, max 10,000 per call. | |
| preview | No | Step 1 of the required two-step write: set true to validate and receive a structured preview (matched / would-assign / would-replace counts) plus a single-use previewReceipt. Nothing is changed until the commit call. | |
| clientId | No | Optional client id (GUID) for operator (unpinned) credentials on 3PL tenants: applies the curve to that client's items instead of the house catalog — get ids from list_clients. Client-pinned credentials omit this; the credential decides. | |
| anchorDate | No | Optional fallback anchor date for Lifecycle curves; each item's own launch date wins. Ignored for Seasonal curves. | |
| warehouseId | No | Optional warehouse id (GUID) to apply the curve at a single warehouse only. Omitted = the assignment covers all warehouses. | |
| idempotencyKey | No | Caller-generated idempotency key; required with previewReceipt to commit. | |
| previewReceipt | No | Step 2 of the required two-step write: the receipt returned by the preview call. Supply together with a fresh idempotencyKey to commit; calls without it are refused. | |
| overwriteExisting | No | When an item already carries a different curve, replace it instead of skipping it (default false = leave existing per-item choices untouched). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| counts | No | ||
| preview | No | ||
| expiresAt | No | ||
| sourceRef | No | ||
| actionItemId | No | ||
| confirmation | No | ||
| correlationId | No | ||
| demandCurveId | No | ||
| approvalResult | No | ||
| idempotencyKey | No | ||
| previewReceipt | No | ||
| idempotentReplay | No |