Generate Demand Curve from History
generate_demand_curve_from_historyGenerate a demand curve FROM the selected items' own sales history and apply it to them, in one governed action. The server derives the shape statistically — a single item uses its own monthly seasonal factors; multiple items use the cohort's per-item-normalized average — so there is deliberately no points input: callers nominate WHICH items, never what the shape looks like. The preview reports the computed shape, how many items' history contributed, and how many already carry a different curve (skipped unless overwriteExisting). Applications are Modulate-only over MCP (re-times demand within the year, never changes annual totals); the created curve records generation provenance (source items, contribution counts, when). Item ids come from list_items (max 10,000 per call); needs enough history to derive a shape (roughly a year covers every season) — the tool refuses with a clear message otherwise. This is a post-onboarding Demand Intelligence tool: do not call it merely to complete onboarding or because sales history was imported. The curve redistributes item demand across time; sales history establishes velocity, and Spark does not require a separate curve per customer.
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": {
"itemIds": "<itemIds>"
},
"name": "generate_demand_curve_from_history"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional curve name; the server derives one from the selection when omitted. | |
| note | No | Optional note on how the items were selected — stored as provenance on each created assignment. | |
| itemIds | Yes | Item ids (GUIDs) to derive from AND apply 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 (computed shape + contribution stats) plus a single-use previewReceipt. Nothing is created until the commit call. | |
| clientId | No | Optional client id (GUID) for operator (unpinned) credentials on 3PL tenants: derives from and applies to that client's items instead of the house catalog. Client-pinned credentials omit this; the credential decides. | |
| description | No | Optional description of when to use this curve. | |
| 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). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| apply | No | ||
| curve | No | ||
| preview | No | ||
| expiresAt | No | ||
| actionItemId | No | ||
| confirmation | No | ||
| correlationId | No | ||
| approvalResult | No | ||
| idempotencyKey | No | ||
| previewReceipt | No | ||
| idempotentReplay | No |