Skip to main content
Glama

Explain Demand Change

explain_demand_change
Read-only

Why an item's demand moved: its last 4 complete weeks of units against the expectation set by the 12 weeks before (direction down / up / flat, or insufficient_data), the weekly series with the same weeks last year, and the reasons Spark's own data supports — each with a category (seasonality, evidence, calendar, price_change, anomaly, stockout), a claim with its numbers, its source and a confidence (high / medium / low). Sources are this workspace's sales history and seasonal shape, submitted demand evidence, demand-calendar events, US retail dates, list-price history, stock-outs and detected demand anomalies; no external market data. dataNotes says what the data could not support. Present only the reasons returned, with their confidence; never add a cause the response does not carry. Read-only.

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": {
      "itemSku": "<itemSku>"
    },
    "name": "explain_demand_change"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemSkuYesItem SKU (exact match, case-insensitive).

Output Schema

NameRequiredDescriptionDefault
okNo
asOfNo
weeksNo
itemIdNo
itemSkuNo
reasonsNo
itemNameNo
dataNotesNo
directionNo
recentWeeksNo
baselineWeeksNo
changePercentNo
expectedBasisNo
recentActualUnitsNo
recentExpectedUnitsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Goes well past the annotations by enumerating the exact data sources consulted (workspace sales history and seasonal shape, submitted evidence, demand calendar, US retail dates, price history, stockouts, detected anomalies), explicitly bounding scope with 'no external market data', and disclosing the dataNotes limitation channel plus the anti-fabrication constraint. That is meaningful behavioral context an agent cannot get from readOnlyHint/openWorldHint.

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?

The core comparison is front-loaded in the first clause and nothing is filler — every list (categories, confidence levels, sources) carries distinct information. It is dense and scanability suffers from long inline enumerations, and the trailing 'Read-only.' merely restates the annotation, but overall it is efficiently packed.

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?

Complete despite an output schema existing: the description still characterizes the response shape (week-over-week comparison, prior-year series, categorized reasons with claims/sources/confidence, dataNotes) and sets the interpretation guardrail. For a single-parameter read-only diagnostic tool, nothing an agent needs before calling is missing.

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

Parameters3/5

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

There is one parameter at 100% schema coverage, with the schema already specifying exact, case-insensitive SKU matching. The description only refers to 'an item's demand' and adds no syntax, format, or edge-case meaning beyond the schema, so baseline 3 applies.

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 analytical operation: why an item's demand moved, defined concretely as last 4 complete weeks of units vs. the expectation set by the prior 12 weeks, yielding down/up/flat/insufficient_data. That level of specificity makes it obviously distinct from forecast, facts, or reporting siblings without needing to name them.

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

Usage Guidelines3/5

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

Usage is implied rather than stated — an agent infers this is the 'explain a demand movement' tool. It gives a strong output-handling rule ('Present only the reasons returned... never add a cause the response does not carry') but no when-to-use-vs-alternative or prerequisite guidance (e.g., when to prefer get_demand_analysis_facts or get_demand_forecast).

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