Skip to main content
Glama

company_stockouts

Reconstruct stockout timelines and compute lost units, revenue, and reorder-point gaps to determine whether shortages came from small or late orders.

Instructions

Build the sealed stockout ledger for the window: every persisted stock position replayed into an on-hand timeline, the days it sat empty and the spells, the velocity while stocked, the units lost at that velocity plus the units the chain recorded as oversold, the contribution lost at the window's margin report (built now from the persisted commerce chains), and the reorder point the policy would have needed against the one it carries, so the recommendation says whether the order was small or late (payload: optional window_start, window_end).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nowNo
engineNo
operationNobuild
entity_refNo
project_idYes
bundle_jsonYes
payload_jsonNo{}

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.2

TDQS

C2.7/5.0
Behavior2/5

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

With no annotations, the description must carry the safety disclosure. It mentions reading from 'persisted commerce chains' but does not state whether the operation is read-only or writes/seals a ledger, nor does it cover permissions, rate limits, or destructive actions. The word 'sealed' is ambiguous and could imply mutation.

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

Conciseness2/5

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

The description is a single dense run-on sentence with no punctuation or separation, making it hard to parse. Key information like the payload syntax is buried at the end, and the flow of logic is not front-loaded or broken into digestible parts.

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

Completeness2/5

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

Despite having an output schema, the input parameters remain unclear: the required project_id and bundle_json are unexplained, and the payload semantics are only partially described. The description covers the computation logic but not enough operational details for correct invocation.

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

Parameters2/5

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

Schema coverage is 0%, so the description must compensate. It only names two optional payload fields (window_start, window_end) and ignores the required project_id and bundle_json, leaving the agent without guidance on the most important parameters. It adds minimal value beyond the raw schema.

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 states a specific verb ('Build') and a specific resource ('sealed stockout ledger') and enumerates the computed metrics (timeline, days empty, velocity, units lost, contribution, reorder point). It is clear in intent and distinct from generic inventory tools, though the run-on structure makes it less crisp than ideal.

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?

The description implies usage via 'Build the sealed stockout ledger for the window' and mentions an optional payload for window_start/end, but it does not state when to prefer this tool over sibling tools like company_inventory or company_fulfilment, nor any exclusions. Usage is thus implied but not explicitly guided.

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

Deploy Server

Other Tools