Skip to main content
Glama

marketbasketanalysis-mcp

analyze_basket

Read-onlyIdempotent

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "product_ids": "<product_ids>"
    },
    "name": "analyze_basket"
  }
}

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, closed-world semantics, so the description only needs to add the scoring behavior — which it does by defining the 0..1 cohesion/affinity measure and its meaning. It doesn't cover edge cases such as sparse order data producing near-zero scores, but it goes meaningfully beyond the structured fields.

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?

The core purpose and the vetted-before-recommending rationale are front-loaded, and the sentences are tight. The trailing list of sample phrasings ('is this a good bundle?', 'analyze this basket') is partly redundant with the opening sentence, though it aids query matching.

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?

For a one-parameter, annotation-rich, output-schema-less tool, this is complete: it states the input shape, the returned value and its range, and the decision it supports. An agent needs nothing more to call it correctly and interpret the result.

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 100% and the single parameter's constraint (2-6 items) is already documented in the schema. The description restates the '2+ products' minimum and clarifies the items belong to a proposed basket, which is only marginal added meaning — 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?

The description gives a specific verb and resource ('Run market-basket analysis on a proposed basket') and states the output ('cohesion score 0..1 representing how strongly they bind together'). It also separates this tool from recommendation-oriented siblings by framing it as a pre-recommendation vetting step rather than a generator of bundles.

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 explicitly says to use this 'to vet a proposed bundle BEFORE recommending it' and explains the failure mode it prevents (plausible-looking bundles with no statistical signal). It doesn't name an alternative tool for the case where the agent should skip analysis, but the timing and intent guidance is clear.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources