Skip to main content
Glama

Generate Demand Curve from History

generate_demand_curve_from_history
Destructive

Generate 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

NameRequiredDescriptionDefault
nameNoOptional curve name; the server derives one from the selection when omitted.
noteNoOptional note on how the items were selected — stored as provenance on each created assignment.
itemIdsYesItem ids (GUIDs) to derive from AND apply to, max 10,000 per call.
previewNoStep 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.
clientIdNoOptional 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.
descriptionNoOptional description of when to use this curve.
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt to commit.
previewReceiptNoStep 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.
overwriteExistingNoWhen an item already carries a different curve, replace it instead of skipping it (default false).

Output Schema

NameRequiredDescriptionDefault
okNo
applyNo
curveNo
previewNo
expiresAtNo
actionItemIdNo
confirmationNo
correlationIdNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
idempotentReplayNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations: discloses that applications are Modulate-only, never change annual totals, record generation provenance, and that insufficient history yields a clear refusal. The two-step preview/commit flow and the overwriteExisting skip default are described, though the schema also carries the receipt/idempotency detail, so the description's marginal contribution there is smaller.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense but front-loaded — the core action and derivation logic lead, with caveats following. The final sentence about 'Spark' and per-customer curves introduces an unexplained internal reference and is the weakest, most expendable line.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With a full output schema, rich annotations, and 9 parameters, the description covers what an agent needs: derivation basis, history prerequisites, preview/commit flow, provenance recording, and scope limits. Nothing material is missing for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description still adds real meaning by framing itemIds as nominating WHICH items (not shape), explaining that single-item vs multi-item runs use different derivation methods, and clarifying when overwriteExisting skips vs replaces.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a precise verb+resource+source: it generates a demand curve FROM the selected items' own sales history and applies it to them. It explicitly distinguishes itself from point-based curve creation by declaring 'there is deliberately no points input' and from generic application tools by describing the one-action derive-and-apply behavior.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-not guidance ('do not call it merely to complete onboarding or because sales history was imported'), names the prerequisite data source (item ids from list_items, max 10,000), states the history requirement with a refusal behavior, and describes the alternative path for existing curves via overwriteExisting.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources