Skip to main content
Glama

Safety Stock Calculator

calculate_safety_stock
Read-only

Calculate how much safety stock to hold to protect against demand and lead-time variability, using the King formula. Returns units and the capital tied up. Free tool by Tru-Stock AI — https://www.tru-stock.ai/tools/safety-stock-calculator

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
unitCostNoUnit cost, to value the safety stock (optional)
demandStdDevNoStandard deviation of daily demand
serviceLevelNoTarget service level: 85, 90, 95, 97 or 99. Default 95
avgDailyDemandYesAverage units sold per day
leadTimeStdDevNoStandard deviation of lead time in days
avgLeadTimeDaysYesAverage vendor lead time in days

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already carry readOnlyHint=true and destructiveHint=false, so the safety profile is fully covered. The description adds value beyond that by revealing the computation method (King formula), the return content ('returns units and the capital tied up'), and the commercial origin. No behavioral side effects are hidden; the only minor gap is not stating the default service level behavior when the parameter is omitted (though the schema covers that).

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?

Two sentences front-load the purpose and method, then the return content. The only filler is the promotional URL and branding ('Free tool by Tru-Stock AI'), which is harmless but adds no decision-making value for the agent. The core information is compact and well ordered.

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?

For a pure-compute tool with six straightforward parameters, high schema coverage, and annotations already declaring it non-destructive, the description is complete. It names the formula, states what the call returns (units + capital), and implies the input variables. Since there is no output schema, the simple 'Returns...' statement fulfills the disclosure job; nothing an agent needs to choose and call the tool correctly is prematurely minimal.

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 all six parameters are fully described in structured form — the baseline for this dimension is 3. The description adds context about the formula (e.g., that the King formula incorporates demand/lead-time std devs) but does not explain parameter interactions such as how the tool behaves when standard deviation fields are omitted. The schema does the heavy lifting here, so a 3 is appropriate.

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?

The description states a specific verb + resource ('Calculate safety stock'), the purpose ('protect against demand and lead-time variability'), the exact method ('King formula'), and what it returns ('units and capital tied up'). This clearly differentiates it from siblings like calculate_reorder_point (reorder point, not safety stock) and estimate_trapped_capital (idle stock value, not safety stock calculation).

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

Usage Guidelines4/5

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

The phrase 'to protect against demand and lead-time variability' gives clear usage context, implicitly signaling when an agent should reach for this tool versus a plain EOQ or turnover calculator. However, it does not explicitly name a sibling alternative nor state when not to use it, leaving a bit of inference to the agent.

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