Skip to main content
Glama

Margins: below cost and thin

margin_check
Read-onlyIdempotent

Detects active products priced below purchase cost, thin margins, or pushed under cost by active automatic discounts; read-only check using Shopware purchase prices.

Instructions

Find active products whose net price is below their purchase price, products with a thin margin, and products that an automatic discount running right now pushes below cost: the '60 % instead of 6 %' mistake on the price side. Uses Shopware's purchase price; products without one are counted, not guessed. Read-only. Returns { checked, withoutPurchasePrice, automaticDiscount, summary, belowCost[], thin[], lossWithDiscount[] }.

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": "margin_check"
  }
}

Input Schema

NameRequiredDescriptionDefault
maxItemsNo
minMarginNoMargin in % below which a product counts as thin

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.11.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive), but the description adds real behavioral context beyond them: the data source ('Uses Shopware's purchase price'), the deliberate edge-case policy ('products without one are counted, not guessed'), and the fact that a currently-running automatic discount is factored in. It does not discuss performance limits or currency handling, which is why it isn't a 5.

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 the core condition and followed by short, high-value clauses (data source, missing-price policy, read-only, return shape). The '60 % instead of 6 %' aside is illustrative rather than filler, though the opening sentence is dense and could be split for faster scanning.

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?

There is no output schema, and the description compensates by enumerating the return keys (checked, withoutPurchasePrice, automaticDiscount, summary, belowCost[], thin[], lossWithDiscount[]). Combined with the disclosed data-source and edge-case policy, an agent has everything needed to call this confidently.

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 sits at 50%: minMargin is documented in the schema as 'Margin in % below which a product counts as thin', while maxItems has bounds and a default but no prose. The description never mentions either parameter, so it adds nothing beyond the schema; the 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 concrete verb ('Find') and three precisely-scoped resources: active products below purchase price, products with thin margin, and products pushed below cost by a running automatic discount. That is specific enough to separate it from adjacent siblings like products_search or stock_get without opening their schemas.

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 scenario is clear from the phrasing ('automatic discount running right now', the '60 % instead of 6 %' price-side mistake), which tells the agent when this diagnostic applies rather than a plain product listing. It stops short of naming explicit alternatives or exclusions, so it lands at 4 rather than 5.

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