Skip to main content
Glama

Average Basket Analysis

ps_average_basket_analysis

Analyze average basket value overall and by month, carrier, and customer group; compare current vs previous periods to show basket trends.

Instructions

Analyse average basket value overall and by month, carrier, and customer group.

Also computes the trend (current period vs previous period) to show whether baskets are growing.

Args:

  • days: Lookback period in days (default: 90)

  • limit: Max orders to analyse (default: 2000)

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

Input Schema

NameRequiredDescriptionDefault
daysNoLookback period in days
limitNoMax orders to analyse

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.1.0

TDQS

B3.2/5.0
Behavior2/5

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

Annotations supply the safety profile (destructiveHint=false, openWorldHint=false, idempotentHint=false), so the description need not repeat it. But readOnlyHint=false is counterintuitive for a tool described purely as an analysis/computation, and the description never explains why it is not read-only or what side effect exists. It also omits whether results are cached, persisted, or cost anything for large lookbacks.

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 trend behaviour are front-loaded in two tight sentences. The trailing Args block is redundant with a fully documented schema, which is the only wasted text; nothing else is padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description must convey what comes back, and it does name the breakdowns and the trend metric at a high level. It still leaves gaps: no mention of currency/units, the shape of 'by month/carrier/customer group' sections, or how the previous period is chosen. The unexplained readOnlyHint=false also remains unaddressed for what is presented as a pure analysis tool.

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% and both parameters carry defaults, min/max bounds, and descriptions in the schema itself. The 'Args' block in the description simply restates those two parameters, adding no syntax, units, or interaction details (e.g., how 'limit' affects statistical accuracy or truncation of the trend). Baseline 3 applies when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb ('Analyse') and resource ('average basket value') plus the exact breakdown dimensions: overall, by month, by carrier, by customer group, and trend vs previous period. This is clearly distinguishable from siblings like ps_customer_ltv or ps_cross_analysis, though it never explicitly names an alternative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the stated outputs (basket value breakdowns plus period-over-period trend), so an agent can infer when the tool is relevant. However there is no explicit 'use this when' guidance, no exclusions, and no pointer to how it differs from other analytical siblings such as ps_customer_ltv or ps_cross_analysis.

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

Deploy Server

Other Tools