Skip to main content
Glama
48x-ai

@marketbasketanalysis/mcp

by 48x-ai

find_substitutes

Find substitute products to replace an unavailable or out-of-stock item, using co-purchase data to rank alternatives with similarity scores and reasons.

Instructions

For a given product, recommend the top substitute items that could REPLACE it (not complement it). Substitutes are the inverse of cross-sell: this answers 'what to buy instead', not 'what to buy with'. Use this when the user asks 'what's a substitute for X?', 'X is out of stock, what's a good alternative?', 'recommend a replacement for Y', 'find an equivalent product', or when a procurement agent needs to swap an unavailable SKU. Returns a ranked list with a similarity score and a reason (context_similar / category_match / vendor_match). Works for all five platforms: Shopify, BigCommerce, WooCommerce, Magento, and OroCommerce.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of substitutes to return. Default 3, max 6.
product_idYesProduct id, either the numeric storefront id (e.g. '8472918765') or the platform-specific GID/SKU. The id of the product the user wants to REPLACE.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral burden. It clearly discloses the return shape: a ranked list with similarity score and a reason category. It also states platform coverage. It does not mention potential side effects, but a recommendation tool is clearly read-oriented.

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?

Every sentence earns its place: core purpose, contrast with cross-sell, example triggers, output format, and platform scope. It is front-loaded with the key definition and contains no filler.

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?

The description fully covers the essential return information despite no output schema, and the input schema fully documents both parameters. The platform list and explicit use examples make this complete for an agent deciding whether to call it.

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 parameters are already well documented in the schema. The description adds only general context ('top substitute items', 'for a given product') without materially enriching the schema's parameter semantics. Baseline 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 uses a specific verb and resource: 'recommend the top substitute items that could REPLACE it'. It actively distinguishes itself from complement/cross-sell tools by stating 'not complement it' and 'inverse of cross-sell', making its purpose unambiguous even among many siblings.

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 provides explicit usage triggers such as 'what's a substitute for X?', 'out of stock', 'replacement', and 'equivalent product', plus the procurement-swap scenario. It also excludes the complement use case, giving concrete when-to-use versus when-not-to-use guidance.

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