Skip to main content
Glama
48x-ai

@marketbasketanalysis/mcp

by 48x-ai

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MBA_API_KEYYesThe mba_live_... key from your admin (required)
MBA_API_BASENoPer-store base URL. Set this for BigCommerce, self-hosted, or staging backends so the server points at your data plane. Must be https:// for non-local hosts.https://app.marketbasketanalysis.com
MBA_PLATFORMNoSet to shopify or bigcommerce to expose platform-gated tools (e.g. predict_reorder).(any)
MBA_SENTRY_DSNNoOpt-in error telemetry (merchant-controlled).
MBA_DEBUG_ERRORSNoSet to 1 to print upstream error bodies to stderr.
ALLOW_LOCAL_API_BASENoSet to 1 to permit localhost in MBA_API_BASE during dev.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_recommendationsA

For a given product, recommend the top complementary, frequently-bought-together products customers also bought, based on mined order-history association rules. This is the single-product cross-sell tool. Use this when the user asks 'what goes with X?', 'what should I bundle with X?', 'what do customers also buy with X?', 'recommend products to cross-sell with X', or similar single-product co-purchase questions. Works for all five platforms: Shopify, BigCommerce, WooCommerce, Magento, and OroCommerce.

find_substitutesA

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.

get_rationaleA

Fetch the one-sentence rationale for why product B is recommended alongside product A. Returns a short merchandiser-grade explanation ('these are commonly bought together by customers buying X') suitable for surfacing in a recommendation tile or chat reply. Use this after get_recommendations / get_bundle_for_cart when the agent or user asks 'why are these recommended together?' or 'explain this pairing'.

get_bundle_for_cartA

Given a list of products already in the cart, recommend products that frequently bundle with the cart to complete a high-confidence bundle. This is multi-item basket analysis for cart completion. Use when the user describes a multi-item cart and asks 'what else do I need?', 'what completes this set?', 'what's missing from this bundle?', 'recommend add-ons for this cart', or similar. Different from get_recommendations: this takes MULTIPLE products and returns items that pair with the cart as a whole, not single-item pairings.

propose_subscription_bundleA

Propose a recurring subscription bundle for a customer based on their first-order items. Given 1-5 seed products the customer has bought, returns a recurring subscription bundle (3-6 items) of the seeds plus complementary products, with a predicted cadence (median days between reorders), a 0..1 confidence score, and a rough monthly_value when prices are known. Use this when a merchant agent asks 'what should they subscribe to?', 'build a monthly subscription bundle from this order', 'propose a subscription bundle', 'recommend a recurring replenishment bundle', or 'what's the right subscription frequency for this customer?'. If a customer_id is supplied the tool blends in the customer's per-SKU reorder cadence; without one it falls back to the seed catalog cohesion alone. Works for all five platforms: Shopify, BigCommerce, WooCommerce, Magento, and OroCommerce (the optional reorder-cadence blend needs a customer_id and is not available on OroCommerce).

score_cross_sellA

Score the cross-sell strength (product affinity) between two specific products. Returns the confidence the merchant's real co-purchase data supports for the pair, or a clear 'no signal' result when there's no qualifying rule. Use this to validate a proposed pair before recommending it, or to answer 'is X a good cross-sell for Y?', 'how strong is the affinity between X and Y?', or 'how often are X and Y bought together?'.

score_return_riskA

Predict return risk for a candidate bundle of 2-6 products. Returns the composite bundle return rate (max of items, since one returned item typically returns the whole bundle), each item's historical return rate, and a low/medium/high risk recommendation. Use this when the user asks 'will this bundle get returned?', 'predict return risk for these items', 'fashion bundle risk', 'is this set risky to ship together?', or when an agent is composing a bundle and wants to verify it won't tank the merchant's return KPIs. Backed by return-aware mining over the merchant's real order + refund history.

analyze_basketA

Run market-basket analysis on a proposed basket / bundle to score its cohesion. Given 2+ products, returns a cohesion score 0..1 representing how strongly they bind together (their affinity) in the merchant's order data. Use this to vet a proposed bundle BEFORE recommending it, so agents can avoid suggesting bundles that look plausible but have no statistical signal. Also useful for 'is this a good bundle?', 'analyze this basket', or 'do these products go together?' questions.

predict_reorderA

For a sales-rep or inventory / account-management agent: predict when a B2B customer / account is due to reorder. Returns predicted next-order dates for every SKU the customer has ordered >=2 times, with confidence based on the regularity of their cadence (reorder prediction / replenishment forecasting). Bucketed into 'overdue' / 'due_soon' / 'on_track' / 'not_predictable'. Use this when the agent asks 'what's Acme Corp due to reorder?', 'when will customer X need more of Y?', 'show me stockout risks for my B2B accounts', or for proactive replenishment workflows. Works on the Shopify, BigCommerce, WooCommerce, and Magento backends. Not available on OroCommerce.

forecast_bundleA

For an inventory, purchasing, or merchant-ops agent: forecast weekly sales and recommend a buy quantity for a specific bundle over a configurable horizon. Uses additive Holt-Winters on the bundle's stored historical sales (demand forecasting). Use this when the agent asks 'how many of bundle X should I order?', 'what should I stock for the next N weeks?', 'what's the demand outlook for bundle Y?', or 'forecast the next 8 weeks for the camera bundle'.

get_weekly_planA

Fetch the current weekly action plan for the merchant: a ranked list of typed actions (publish opportunity, retire stale bundle, reorder inventory, investigate drift, etc.) the merchant should take this week. Use this when a merchant asks 'what should I work on this week?', 'what's on my plate?', 'show me my weekly plan', or wants a summary of pending tasks before opening the admin. Merchant-ops surface: BigCommerce today; on other platforms merchants manage this from the admin, and the tool returns a clear not-available message.

execute_weekly_plan_actionA

Execute a specific action from the merchant's weekly plan (publish bundle, run mining job, archive rule, etc.). Idempotent by action_id, safe to retry. Use this AFTER the merchant has confirmed which action from get_weekly_plan they want to run; do not call preemptively. Merchant-ops surface: BigCommerce today; on other platforms merchants manage this from the admin, and the tool returns a clear not-available message.

get_opportunitiesA

List the merchant's ranked bundle / cross-sell opportunities mined from order history, with support / confidence / lift / revenue-weighted score. Use this when a merchant asks 'what are my top opportunities?', 'show me the best bundles I haven't published yet', or 'what should I prioritize?'. Pair with triage_opportunity to act on a specific one. Merchant-ops surface: BigCommerce today; on other platforms merchants manage this from the admin, and the tool returns a clear not-available message.

explain_opportunityA

Explain ONE mined opportunity: return its support, confidence, lift, and order sample count plus a short plain-language narrative of why the pair is a good cross-sell. Use this when a merchant asks 'why is this a good cross-sell?', 'explain this opportunity', or 'why should I bundle these?' after seeing it in get_opportunities. Different from get_opportunities: that lists the ranked set, this drills into a single opportunity_id with the stats spelled out in a sentence. Different from get_rationale: rationale is a generic pair 'why', this is the specific mined opportunity's own numbers. BigCommerce only today.

triage_opportunityA

Pause, activate, or archive a specific opportunity from get_opportunities. State-mutating; guarded by confirm=true. Use this after the merchant has explicitly picked an opportunity to act on. Pass action='activate' to publish a proposed rule, 'pause' to temporarily hide an active one, 'archive' to permanently retire it. Merchant-ops surface: BigCommerce today; on other platforms merchants manage this from the admin, and the tool returns a clear not-available message.

get_drift_alertsA

For a merchant-ops or analytics agent: list active drift alerts, the recommendation rules whose confidence has materially changed (weakened, strengthened, disappeared, emerged) versus the prior mining job. Use this when a merchant asks 'what's changed?', 'is my model still accurate?', 'are any rules drifting?', or wants to investigate a SKU swap / seasonal shift. Merchant-ops surface: BigCommerce today; on other platforms merchants manage this from the admin, and the tool returns a clear not-available message.

explain_driftA

Explain ONE drift alert: return its prior and current confidence (plus support, lift, and order sample count when the rule is still live) and a short plain-language narrative of how the pair moved versus the prior mining run. Use this when a merchant asks 'why did this pair drift?', 'explain this alert', or 'what changed for these two products?' after seeing it in get_drift_alerts. Different from get_drift_alerts: that lists the feed, this drills into a single alert_id with the change spelled out in a sentence. Handles a disappeared pair gracefully (only the prior confidence is available). BigCommerce only today.

get_forecast_alertsA

For an inventory or merchant-ops agent: list forecast-based alerts, the bundles with stockout risk, demand drop, demand spike, or an unreliable forecast curve. Use this when a merchant asks 'what's at risk of stockout?', 'which bundles are losing demand?', 'do I need to reorder anything?', or 'what should I restock?'. Pair with forecast_bundle to drill into a specific bundle. Merchant-ops surface: BigCommerce today; on other platforms merchants manage this from the admin, and the tool returns a clear not-available message.

mine_hui_itemsetsA

Run high-utility itemset (HUI) mining on a caller-supplied payload of orders + per-line unit_profit. Returns top-K itemsets ranked by aggregate utility (sum of profit across all occurrences). Use this when an agent needs to evaluate which item combinations drive the most profit (not just frequency) for a specific time window or product subset. Plus or Enterprise tier required on the merchant account.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4/5.0

Scored across 19 tools

Disambiguation4/5

Most tools are clearly differentiated by resource and action (single-product vs cart vs subscription, list vs explain vs act), and several descriptions explicitly call out differences from related tools. However, the cluster of explanation tools (get_rationale, explain_opportunity, explain_drift) and the several scoring/analysis tools (score_cross_sell, analyze_basket, score_return_risk) could still cause minor selection confusion from names alone.

Naming Consistency4/5

All tool names follow snake_case verb_noun conventions and are mostly predictable (get_*, explain_*, score_*). There are minor inconsistencies: related recommendation tools use different verbs (get_recommendations, find_substitutes, propose_subscription_bundle, get_bundle_for_cart), and predict_reorder vs forecast_bundle split an otherwise uniform forecasting concept.

Tool Count3/5

With 19 tools, the server sits in the 16-25 range, which feels heavy and exceeds the ideal well-scoped 3-15 band. The count is defensible given the broad domain coverage, but agents will need to navigate a large surface to find the right tool.

Completeness4/5

The tool surface covers a comprehensive market-basket workflow: recommending, substituting, scoring, explaining, mining, alerting, forecasting, and acting on opportunities. Minor gaps exist—such as no direct tool for managing custom rules beyond triage and no bulk scoring—but the core domain is well covered with no critical dead ends.

Maintenance

ActivityMaintained
ResponsivenessNo issues