Skip to main content
Glama

Cheapest Grocery Basket

Cheapest way to buy a whole list, including splitting stores

cheapest_basket

The complete buying decision for a shopping list: the cheapest single store that can fill it, AND the cross-store optimum that buys each line wherever it is cheapest, with the dollar savings between them and how many stops that costs. Every line carries substitutes at the other stores with the exact extra cost of choosing them, so a shopper can collapse a two-stop trip into one and see precisely what that convenience costs. Out-of-stock items are skipped in favour of an in-stock option even when it is dearer. Use this as the default for "where should I buy this list today" — it is the one call that answers the whole question. Costs $0.02 USDC per call via x402 on Base.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
zipYes5-digit US ZIP code, e.g. '30501'.
modeNoOptional fulfillment intent: 'pickup' or 'delivery'.
itemsYesComma-separated shopping list, optionally with quantities, e.g. 'milk x2, eggs, bread, butter, cheese'. A JSON array of {name, quantity} is also accepted.
storesNoOptional comma-separated chains the shopper is willing to visit, e.g. 'aldi,publix'.
maxAgeDaysNoOptional freshness limit in days (default 14, max 120). A price read longer ago than this is withheld rather than returned as if current; raise it to accept older readings.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / items / examples
      Added value: +[
      +  "milk x2, eggs, bread, butter, cheese"
      +]
    • addedInput schema / properties / maxAgeDays / examples
      Added value: +[
      +  14
      +]
    • addedInput schema / properties / mode / examples
      Added value: +[
      +  "pickup"
      +]
    • addedInput schema / properties / stores / examples
      Added value: +[
      +  "aldi,publix"
      +]
    • addedInput schema / properties / zip / examples
      Added value: +[
      +  "30501"
      +]
  2. Changed1 schema field changed
    • addedInput schema / properties / maxAgeDays
      Added value: +{
      +  "description": "Optional freshness limit in days (default 14, max 120). A price read longer ago than this is withheld rather than returned as if current; raise it to accept older readings.",
      +  "maximum": 120,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  3. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses key behaviors: it computes both single-store and cross-store optima, reports savings and stop count, provides substitutes with extra cost, skips out-of-stock items in favor of in-stock even if dearer, and notes a per-call cost of $0.02 USDC. This is substantial behavioral coverage.

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 description is a bit long but every sentence adds value: it covers purpose, output details, substitution logic, out-of-stock handling, usage guidance, and cost. The core purpose is front-loaded, and the structure is logical. It could be slightly tightened but is appropriately sized for the complexity.

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

Completeness4/5

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

For a complex optimization tool with no output schema, the description explains what it returns (savings, stop count, substitutes with costs) and its behavior. It mentions cost and out-of-stock handling. It does not detail the exact response structure or error handling, but it gives enough for an agent to understand what to expect and call it correctly.

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 input schema already provides 100% coverage with descriptions for all five parameters, so the baseline is 3. The main description does not add new parameter semantics beyond what the schema gives; it only refers to 'shopping list' and 'stores' which are already documented. It adds context about what the tool does with the parameters but not new meaning.

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 states a very specific verb and resource: it computes the cheapest single store and the cross-store optimum for a shopping list, with savings and stop count. It clearly differentiates itself from siblings by positioning as 'the one call that answers the whole question' and 'the default for where should I buy this list today', making it unmistakable.

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 tells when to use this tool ('Use this as the default for where should I buy this list today') and implies it is the comprehensive option. It does not explicitly name alternatives or exclusions, but the default and 'one call' phrasing provides clear context for when it is the right choice.

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