Skip to main content
Glama

Stock Alert Check

ps_stock_alert_check

Checks product stock against configured warning and critical thresholds and reports alerts, saving current and historical alert data for PrestaShop inventory monitoring.

Instructions

Compare current product stock against configured thresholds and report alerts.

Reads thresholds from /data/stock_alert_config.json (created with defaults if absent). Default config: { default_threshold: 5, critical_threshold: 0 }

Returns summary: { total_warnings, total_critical, alerts[] } Writes current alerts to /data/stock_alerts.json and history to /data/stock_alerts_history.json.

Args:

  • lang_id: Language ID for product names (default: "1")

  • limit: Max products to check (default: 500)

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "ps_stock_alert_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax products to check
lang_idNoLanguage ID for product names1

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Goes meaningfully beyond the annotations by disclosing that it reads /data/stock_alert_config.json and auto-creates defaults, and that it writes alerts to /data/stock_alerts.json plus history to a separate file. This explains why readOnlyHint is false despite the read-flavored name. It does not say whether prior alert files are overwritten or whether concurrent runs conflict, which is the main remaining gap.

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

Conciseness5/5

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

Front-loads the one-line purpose, then layers config source, return shape, side effects, and arguments in a scannable order. Every sentence carries information; nothing is padded.

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

Completeness4/5

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

With no output schema, the description supplies the return shape (total_warnings, total_critical, alerts[]), the config defaults, and the side-effect files, which is sufficient to call it correctly. Only overwrite semantics and failure behavior when the data directory is unwritable are unaddressed.

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 parameters including defaults and the maximum. The Args section merely restates lang_id and limit verbatim, adding no meaning such as what lang_id values exist or how limit interacts with performance.

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?

States a specific verb and resource: compares current stock against configured thresholds and reports alerts. It is implicitly distinguishable from ps_configure_stock_alerts (which manages thresholds) and ps_get_product_stock (single lookups), but never names those alternatives to make the split explicit.

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 only implied: the agent can infer this is the reporting step after thresholds are configured, and that it is a batch sweep limited by 'limit'. There is no explicit statement of when to prefer this over ps_low_stock_report or ps_list_stock, and no preconditions or exclusions are given.

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