Skip to main content
Glama

batch_search

ADVANCED / manual selection. Do NOT use this to build a shopping list: for any list of 2 or more items, call build_basket (one call, server-side, cheapest pick per item). Use batch_search only when you need the RAW candidate products for items you intend to select MANUALLY (for example, to override build_basket's pick on one item). It searches multiple items in parallel and returns raw candidate products per query (up to candidates_per_retailer per retailer) with NO filtering or scoring applied.

WORKFLOW:

  1. Call batch_search with your shopping list items

  2. Review the candidates for each item. For each query, pick the single best product_id per retailer that actually matches what the user wants (correct product type, reasonable size, not a different product). If none of the candidates are a good match for a query, call batch_search again with a refined query (e.g., more specific terms, different wording)

  3. Once you have confirmed product_id selections for all items, call save_basket with your picks

TIPS:

  • Set product_type to help narrow results to the right category (e.g., fresh_produce for herbs and vegetables)

  • Each candidate includes a product_categories field (JSON array of retailer category labels like 'Yoghurt', 'Herbs & Spices', 'Sausages'). Use this to distinguish the actual product type when names are ambiguous (e.g., 'oregano' the herb vs 'oregano sausages')

  • Prefer products where the name clearly matches the query intent

  • For staples (milk, eggs, bread), the cheapest option is usually the store brand

  • If results look wrong (e.g., searching 'rosemary' returns snacks instead of herbs), retry with a more specific query like 'fresh rosemary'

  • Each item includes a 'cheapest' hint with one entry per retailer. This is the cheapest candidate whose product_categories match the inferred subcategory for the query, NOT necessarily the lowest unit_price overall: a clearly off-category cheaper item (e.g., a snack bar under 'peanut butter') is deliberately excluded. When no category signal is available it falls back to the raw lowest unit_price. Treat the hint as advisory and confirm against the full candidate list and the user's intended format.

AMBIGUITY: When candidates for a query span clearly different product formats (e.g., microwave rice pouches vs dry rice bags, single-serve vs family/bulk sizes, flavoured vs plain variants, fresh vs frozen), ASK the user which format they prefer before selecting a product. Compare the size field across candidates to detect this: a spread from 125g to 5kg signals format ambiguity. Do not silently pick the cheapest option when it may be the wrong format (e.g., a 250g microwave pouch when the user likely wants a 1kg bag).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesList of grocery items to search (1-20 items).
retailersNoFilter to these retailers only. If omitted, all 4 are searched.
candidates_per_retailerNoNumber of candidate products to return per retailer per item (1-30, default 10). Use more candidates if you expect ambiguous results.

TDQS

A5/5.0
Behavior5/5

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

Even without annotations, the description fully discloses behavioral traits: parallel search, no filtering/scoring, per-retailer candidate limits, the 'cheapest' hint logic (advisory, may exclude off-category cheaper items), and the product_categories field to distinguish ambiguous names. This transparency goes well beyond what annotations might have provided.

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 long but highly structured (ADVANCED/use cases, WORKFLOW, TIPS, AMBIGUITY). Every sentence provides actionable guidance; there is no repeated or filler content. The length is justified by the tool's complexity and the need to guide manual product selection.

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?

Given no output schema or annotations, the description is remarkably complete: it explains what the tool returns (raw candidates, cheapest hint), how to handle ambiguous results, when to retry, and how to proceed with save_basket. It covers all essential aspects for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 100% schema coverage, the description adds rich parameter semantics: candidates_per_retailer should be increased for ambiguous results, product_type narrows results, category overrides product_type, and the 'cheapest' hint's behavior is clarified. This guidance is not present in the schema.

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 clearly states the tool's purpose: it searches multiple items in parallel and returns raw candidate products with no filtering or scoring applied. It explicitly distinguishes itself from build_basket, positioning batch_search as the manual selection tool for cases where the user wants to override automatic picks.

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

Usage Guidelines5/5

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

The description provides explicit when-to-use and when-not-to-use guidance: "Do NOT use this to build a shopping list... call build_basket". It also explains the exact workflow (batch_search → review candidates → call save_basket) and gives tips for refining queries when results look wrong.

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.

TDQS

A4.3/5.0
Disambiguation3/5

batch_search, search_products, and get_cheapest all provide product search with overlapping output, and build_basket/save_basket both handle basket creation. However, detailed usage notes (mandatory vs. advanced) help clarify, though an agent could still misselect among the search tools.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern in lowercase_snake_case (e.g., batch_search, compare_prices, get_product), making the API predictable and easy to learn.

Tool Count5/5

10 tools is well within the ideal 3-15 range and appropriately scoped for a grocery price-comparison and basket-building service, covering search, comparison, history, specials, and basket workflows without redundancy.

Completeness5/5

The tool set covers the full grocery shopping lifecycle: searching products, comparing prices by barcode, viewing price history, checking specials, building baskets, and saving manually curated selections. No obvious gaps for typical user requests.

Resources