Skip to main content
Glama

Cross-Dataset Analysis

ps_cross_analysis
Read-onlyIdempotent

Analyze stock and order data server-side to find dead products, low movers, or out-of-stock items with demand, returning compact results without manual pagination.

Instructions

Perform server-side cross-dataset analysis combining stock and order data. Returns only the final compact result — no intermediate raw records are exposed. Use this instead of manually paginating ps_list_stock + ps_list_orders to avoid filling the context window.

analysis_type options: • "dead_products" — products with stock > threshold but 0 units sold in the last days days • "low_movers" — products with stock > threshold and fewer than threshold units sold (sorted by velocity asc) • "out_of_stock_with_demand" — products with quantity = 0 that had at least 1 sale in the last days days

Supports pagination via limit + offset for large catalogues.

Args:

  • analysis_type: One of "dead_products", "low_movers", "out_of_stock_with_demand" (required)

  • days: Lookback period in days for sales data (default: 90)

  • threshold: Stock quantity threshold; interpretation depends on analysis_type (default: 0)

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

  • limit: Max products to scan from PrestaShop (default: 200, max: 500)

  • offset: Skip N products — use with limit to paginate large catalogues (default: 0)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "analysis_type": "<analysis_type>"
    },
    "name": "ps_cross_analysis"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoLookback period in days
limitNoMax products to scan
offsetNoPagination offset for large catalogues
lang_idNoLanguage ID for product names1
thresholdNoStock quantity threshold (dead_products/low_movers: min stock to consider; out_of_stock_with_demand: ignored)
analysis_typeYesType of analysis to perform

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered; the description adds genuinely new behavior: only the compact final result is returned and no intermediate raw records are exposed, plus that limit counts products scanned server-side rather than results. The remaining gap is that with no output schema, the shape of the returned records is never described beyond "compact result".

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?

Front-loaded with purpose and the alternative-to-avoid, then organized into scannable bullet lists for analysis types and args. The trailing Args block partly duplicates the already-complete input schema, so a small amount of the text doesn't earn its place.

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?

For a 6-parameter analysis tool with full schema coverage and no output schema, the description covers mode selection, threshold interpretation, and pagination caveats. The one thing an agent still can't determine is the field-level shape of the returned products, which matters given there is no output schema.

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

Parameters4/5

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

Schema coverage is 100% and the schema already explains most parameters, but the description adds real interpretive value the schema lacks: what each analysis_type actually computes (e.g. dead_products = stock above threshold with zero units sold in `days`) and how `threshold` changes meaning per mode. It largely repeats the days/limit/offset defaults already in the schema, which keeps it just short of a 5.

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 opening sentence gives a specific verb+resource (server-side cross-dataset analysis of stock and order data) and immediately contrasts it with the manual alternative ps_list_stock + ps_list_orders. The three enumerated analysis_type values further pin down exactly what the tool computes, so an agent can distinguish it from sibling report tools 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 Guidelines5/5

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

It states explicitly when to prefer this tool ("Use this instead of manually paginating ps_list_stock + ps_list_orders to avoid filling the context window") and describes the condition that selects each analysis_type variant. Sibling names are given concretely rather than left to inference.

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