Skip to main content
Glama

Smart Restock Predictor

smart_restock_predictor

Calculates exact reorder quantities for low-stock products from demand velocity, supplier lead time, safety buffer, and current stock, with optional category filtering.

Instructions

Evaluates every low-stock item and recommends an exact reorder quantity. The recommendation is derived from each product's demand velocity (units sold per day over recent order history), projected demand across an assumed 14-day supplier lead time plus a 7-day safety buffer, minus current stock on hand. Items with no recent sales history fall back to a conservative flat restock quantity. Results are ordered by days of cover (stock remaining / daily velocity), so the first recommendation is the item that runs out first; items with no measurable demand report a null daysOfCover and sort last. An optional category restricts the plan to one category; the echoed 'filters' block reports the category actually applied.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoRestrict to a single category, e.g. 'tech', 'apparel', or 'home'. Case-insensitive. Omit to cover the whole catalog.
thresholdNoStock level at or below which a product is considered for restocking. Defaults to 5 if omitted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
windowYes
filtersYes
assumptionsYes
thresholdUsedYes
recommendationsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.1

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does it well: it discloses the demand-velocity formula, the hardcoded 14-day lead time and 7-day safety buffer assumptions, the flat-quantity fallback for items with no history, and the days-of-cover sort with nulls last. It never explicitly states this is a non-mutating computation, which is the only real gap.

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 purpose is front-loaded in the first sentence and the remaining detail is dense rather than padded. Slightly long, but each sentence (formula, assumptions, fallback, sort order, filter echo) carries information the agent needs to trust the output.

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?

An output schema exists, so return values need not be explained, and the description still covers ordering semantics, null daysOfCover behavior, and filter echoing. For a two-parameter computed-read tool this is complete.

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 documents both category and threshold (including the default of 5). The description adds the useful detail that the applied category is echoed back in a 'filters' block, but contributes nothing for threshold — 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 specific verb and resource ('Evaluates every low-stock item and recommends an exact reorder quantity'), which distinguishes it from the alert-listing sibling get_low_stock_alerts — this tool quantifies, that one notifies. An agent can tell what it produces without opening the schema.

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: you use it when you need reorder quantities for low-stock items, and the optional category narrows the plan. There is no explicit when-not guidance or reference to the sibling alert/product tools, so the agent must infer routing.

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