Skip to main content
Glama
48x-ai

@marketbasketanalysis/mcp

by 48x-ai

analyze_basket

Scores how strongly products in a proposed basket co-occur in order data, returning a 0..1 cohesion score to validate bundle recommendations before making them.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
product_idsYesThe products in the proposed basket (2-6).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations carrying the burden, the description clearly discloses the key behavioral trait: it returns a numeric cohesion score between 0 and 1 based on merchant order data. It also communicates the statistical-signal framing and the decision-oriented purpose. It could go further by noting any caveats, edge cases, or failure behavior, but for a read-only scoring tool the core behavior is well explained.

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?

The description is efficiently structured: first sentence states the core action and output, second sentence gives the primary use case, third sentence adds query paraphrases. Every sentence earns its place and there is no redundant or vague 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 tool is simple (one parameter, no output schema), and the description covers all an agent needs: what the tool does, what input it expects, what the output represents, when to use it, and example user-phrasing signals. It is sufficiently complete for both selection and invocation.

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?

The schema already fully describes product_ids as 'The products in the proposed basket (2-6)' with min/max constraints at 100% coverage. The description adds slight framing ('Given 2+ products', 'proposed basket/bundle') but does not meaningfully extend the semantics beyond what the schema already states. 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 names a specific verb ('Run market-basket analysis'), resource ('proposed basket / bundle'), and outcome ('cohesion score 0..1'). It also distinguishes itself from sibling generation tools by framing itself as a vetting step 'BEFORE recommending' a bundle, making it clear this is an evaluation tool rather than a recommendation or forecasting tool.

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?

It gives explicit usage context: use to vet a proposed bundle before recommending it and to avoid plausible-but-unsupported bundles. It also lists natural-language triggers ('is this a good bundle?', 'do these products go together?'). It stops short of naming sibling alternatives or stating when not to use the tool, so it earns a 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.