Skip to main content
Glama

decompose_product

ADVANCED / single item. Do NOT use this to build a shopping list: for any list of 2 or more items, call build_basket (one call, server-side). Use decompose_product only to break ONE item into structured search attributes when you intend to override build_basket's pick for that single item. This does not call any API; it is a structured reasoning step.

OUTPUT: canonical_query, disqualifiers, and suggested_category for that single item.

Fill in every field based on what a typical Australian family would mean by this item. CORE RULE: Unless the user literally specifies a brand, brand_preference MUST be null and the strategy is cheapest-first (unit_price_asc, no retailer filter).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
quantityYesTarget size. Use to filter results after search. Family intent means prefer larger sizes for better unit price.
raw_inputYesThe item exactly as the user wrote it
qualifiersYesSoft preferences that improve a match but don't disqualify if absent. e.g. ['skinless', 'boneless'] for chicken breast, ['Australian'] for sultanas
category_pathYesOntological path from general to specific, e.g. ['meat', 'poultry', 'chicken', 'breast'] or ['pantry', 'cereal', 'wheat biscuits']
disqualifiersYesTerms that indicate a WRONG product. Results containing these MUST be excluded. e.g. for 'chicken breast': ['thigh', 'drumstick', 'wing', 'nugget', 'schnitzel', 'crumbed', 'marinated']. For 'Vegemite': ['twist', 'scroll', 'shapes', 'cheesy bite']. For 'strawberries': ['yoghurt', 'jam', 'ice cream', 'flavoured']. For 'milk': ['flavoured', 'chocolate', 'coffee', 'almond', 'oat', 'soy', 'coconut'].
canonical_queryYesThe cleaned search term to use with search_products. Strip sizes and brands (unless brand IS the product, like 'Vegemite'). 'chicken breast bulk pack' becomes 'chicken breast fillets'. 'Sanitarium Weet-Bix' becomes 'Weet-Bix'. 'full cream milk 2L' becomes 'full cream milk'.
barcode_eligibleYestrue for branded packaged goods (Weet-Bix, Vegemite, cheese slices, chips). false for fresh produce, meat, and store-brand generics. When true AND a result has a barcode, call compare_prices to check if another retailer has it cheaper.
brand_preferenceNoONLY set this if the user LITERALLY named a brand (e.g. 'Weet-Bix', 'Vegemite'). If the user wrote a generic item like 'milk', 'chicken breast', 'eggs', 'bread', this MUST be null. When null, Pinch finds the cheapest option regardless of brand.
suggested_categoryNoThe grocery store category to filter search results. Use this to prevent wrong-category contamination. e.g. 'Pantry' for rice crackers (prevents dairy lunch packs), 'Fruit & Vegetables' for fresh produce, 'Meat & Seafood' for meat, 'Dairy, Eggs & Fridge' for dairy, 'Frozen' for frozen items. Only set when the item clearly belongs to one category and cross-category results would be noise.

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries full burden and excels: 'This does not call any API; it is a structured reasoning step' clearly discloses no external side effects. It also states the output fields and core rule about brand_preference, which gives the agent a clear model of behavior.

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?

Well-structured and front-loaded: opens with 'ADVANCED / single item', then exclusion, purpose, non-API clarification, output summary, and core rule. Every sentence earns its place, and the length is appropriate for a complex reasoning tool.

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?

No output schema exists, but the description explicitly names the expected output fields (canonical_query, disqualifiers, suggested_category). Combined with the usage guidance and behavioral transparency, it gives the agent everything needed to invoke the tool 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?

Schema description coverage is 100%, so baseline is 3. The description adds some context (e.g., 'typical Australian family' and the brand rule) but these largely reinforce what's already in the schema. No significant new semantic meaning beyond 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: 'break ONE item into structured search attributes' and 'structured reasoning step'. It also distinguishes from sibling build_basket by specifying it's for a single item only.

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?

Explicitly provides when-to-use and when-not-to-use guidance: 'Do NOT use this to build a shopping list: for any list of 2 or more items, call build_basket' and 'Use decompose_product only to break ONE item... when you intend to override build_basket's pick'. This is textbook usage clarity.

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