Skip to main content
Glama

Compare stock across stores

commerce_find_stock_discrepancies
Read-onlyIdempotent

Compares stock levels for the same product across connected stores to surface discrepancies without changing anything. Pair items by config mapping or unique SKU/EAN and flag ambiguous matches.

Instructions

Compares stock for the same product on several connections. Pairs items by explicit config mapping first, then by SKU/EAN only when unique in each store; ambiguous or unmatched items are listed rather than guessed. Changes nothing. Optionally pass sourceOfTruth (a connection id) to get suggested updates, which can be turned into a reviewable proposal with commerce_prepare_stock_update.

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

Input Schema

NameRequiredDescriptionDefault
connectionIdsNoConnection ids to include (see commerce_list_connections). Omit for all connections.
sourceOfTruthNo
maxItemsPerConnectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-destructive behavior, yet the description adds decision-relevant semantics they cannot carry: the precedence order for item matching and the deliberate choice to list ambiguous or unmatched items rather than guess. It also discloses the downstream workflow (suggested updates become a proposal via commerce_prepare_stock_update), which shapes how the agent should interpret and act on results.

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?

Three compact sentences, front-loaded with the comparison purpose and immediately followed by the matching rules that determine result interpretation. Every clause carries information; the short 'Changes nothing' line is the only near-redundancy against readOnlyHint.

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 zero-required-parameter read tool with no output schema, the definition covers purpose, matching semantics, ambiguity handling, and the optional follow-up path. The remaining gap is return value shape: it never indicates what a discrepancy entry or a suggested update looks like, nor whether results are flagged when per-connection limits are hit.

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 coverage is only 33%: connectionIds is documented in the schema and mirrored here, and sourceOfTruth is properly explained as a connection id that unlocks suggested updates. However, maxItemsPerConnection (default 1000, max 5000) is never mentioned in the description, leaving a truncation risk that could make a comparison silently partial.

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 specific verb and resource with scope: compares stock for the same product across several connections. The pairing rule (config mapping first, then SKU/EAN only when unique) makes it unmistakably distinct from a single-store report like commerce_inventory_report or a threshold query like commerce_low_stock.

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?

Gives an explicit conditional for the optional parameter: pass sourceOfTruth to obtain suggested updates, and routes the agent to commerce_prepare_stock_update to turn those into a reviewable proposal. It does not explicitly say when to prefer this over related read tools such as commerce_inventory_report, so it stops short of full routing guidance.

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