Skip to main content
Glama

Calculate Stockout-Adjusted Replenishment & Reorder Points

calculate_replenishment_plan
Read-onlyIdempotent

Computes stockout-adjusted reorder points, safety stock, and carton-rounded order quantities for each SKU, helping prevent stockouts and excess inventory.

Instructions

Replaces Shopify Stocky's retired forecasting brain. Computes margin-weighted ABC classes, stockout-adjusted daily sales velocity, demand + lead-time variability safety stock (SS = Z * sqrt(LTsigma_d^2 + d^2sigma_LT^2)), reorder points, inventory position (On-Hand + On-Order - Committed - Backorders), days of cover, and carton-rounded order recommendations. Free Local Sandbox processes up to 25 SKUs per call; Pro/License unlocks unlimited SKUs and Live Shopify sync.

Input Schema

NameRequiredDescriptionDefault
skusNoStructured SKU inventory + velocity rows.
demo_modeNoRun immediately against the built-in US Shopify merchant dataset (no API keys required).
window_daysNoLookback window in days when parsing CSV or querying live Shopify orders.
inventory_csvNoRaw CSV exported from Shopify Admin Products or merchant reorder spreadsheet.
service_levelNoTarget cycle service level used for Z-score safety stock calculation (85%=1.04, 90%=1.28, 95%=1.65, 97.5%=1.96, 99%=2.33).95%
supplier_rulesNoOptional supplier rules (e.g. from migrate_stocky_csv_snapshot) to apply vendor lead_time_days overrides.
use_live_shopifyNoPull live variants and paid order velocity from configured Shopify Admin GraphQL API (Pro / License).
review_period_daysNoDays between purchasing review cycles (e.g., 7 for weekly, 14 for bi-weekly).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive behavior, so safety needs no restating. The description still adds real value beyond them: it enumerates the computed outputs, discloses the 25-SKU sandbox cap versus unlimited on Pro/License, and flags that live sync requires a configured Shopify Admin connection. It does not mention whether results are persisted or purely computed, but the readOnlyHint covers the risk profile.

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 opening sentence front-loads purpose and the remainder packs the output list, the formula, and quota constraints with little wasted prose. It is dense but every clause earns its place; the only soft spot is the jump from formulas to pricing tiers mid-paragraph.

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

Completeness3/5

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

There is no output schema, so the description's output enumeration is essential and it delivers that well, along with tier limits. What is missing is the input-mode story: an agent is not told that data can arrive via the skus array, a raw CSV, or live Shopify, or how those interact. For a tool with 8 optional top-level parameters and three mutually alternative data sources, that gap is material.

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?

Schema description coverage is 100%, so the schema already carries the parameter burden (service_level Z-scores, stockout_days, case_pack, supplier_rules overrides). The description adds no parameter-level guidance of its own beyond the safety-stock formula and the tier limit. Baseline 3 is appropriate.

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

Purpose4/5

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

The description names a specific verb and resource (computes replenishment plan / reorder points) and enumerates the concrete outputs: ABC classes, stockout-adjusted velocity, safety stock, reorder points, inventory position, days of cover, carton-rounded recommendations. It is unmistakably distinct in substance from build_supplier_purchase_orders or reconcile_po_three_way_match, though it never names a sibling to draw the boundary explicitly.

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?

Implied usage is clear (forecasting/replenishment planning), and the free-tier ceiling of 25 SKUs per call plus the Pro/License requirement for live Shopify sync is useful call-time context. However, nothing says when to use this tool versus build_supplier_purchase_orders (the downstream PO builder) or migrate_stocky_csv_snapshot, nor how to choose among the three input modes (skus, inventory_csv, use_live_shopify).

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