Skip to main content
Glama

Find cheapest product

kh_find_cheapest
Read-onlyIdempotent

Find the minimum in-stock price for a product keyword, returning a flat list sorted by payable price in Toman. Filter by category or require all query words in titles.

Instructions

Find the cheapest in-stock products for a keyword, one flat list by payable price (Toman).

Use for the lowest price of X. Drops loose matches whose title lacks a query word (match_all_words). Narrow with category_id. complete=false: matches go on past scanned, raise scan. Next: kh_product.

Input Schema

NameRequiredDescriptionDefault
scanNoMax search results to scan, cheapest first, 300 per request.
limitNoMax offers to return.
queryYesProduct name or keyword, Persian or English, e.g. 'کرم مرطوب کننده' or 'cerave'.
category_idNoCategory id from kh_categories or kh_search, e.g. 145 (moisturizers).
match_all_wordsNoKeep only products whose title or brand contains every query word.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.2.0
    • removedInput schema / properties / category_id / title
      Removed value: -"Category Id"
    • removedInput schema / properties / limit / title
      Removed value: -"Limit"
    • changedInput schema / properties / match_all_words / description
      Previous value: -"Keep only products whose Persian or English title or brand contains every word of the query."New value: +"Keep only products whose title or brand contains every query word."
    • removedInput schema / properties / match_all_words / title
      Removed value: -"Match All Words"
    • removedInput schema / properties / query / title
      Removed value: -"Query"
    • removedInput schema / properties / scan / title
      Removed value: -"Scan"
    • removedInput schema / title
      Removed value: -"kh_find_cheapestArguments"
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "title": "kh_find_cheapestDictOutput",
      -  "type": "object"
      -}New value: +null
  2. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already cover the read-only/idempotent safety profile, but the description adds real behavior: it drops loose title matches via match_all_words and explains that complete=false means matches continue past `scanned`, so the agent should raise scan. That scan/completeness mechanism is genuinely useful and not derivable from the annotations.

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?

Dense and front-loaded: purpose first, then trigger, filtering, narrowing and next-step in four terse clauses. The telegraphic style ('complete=false: matches go on past scanned, raise scan') is efficient but borders on cryptic for an uninitiated agent.

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?

With no output schema, the description usefully explains the `complete` return flag and the scan-raise remedy, and all five parameters are documented in the schema. It remains silent on the exact shape of returned offers and how limit interacts with truncation, which would round it out.

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

Parameters4/5

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

Schema coverage is 100%, so the schema documents each parameter. The description still adds value by tying match_all_words to its filtering effect and linking the `scan`/`complete` interplay, though it omits detail on limit and truncation semantics beyond the schema.

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?

States a specific verb+resource ('find the cheapest in-stock products for a keyword') plus the sort criterion (payable price in Toman). It is clearly scoped but never names kh_search/kh_deals as the non-cheapest-dedicated alternatives, so sibling differentiation is left to inference.

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?

'Use for the lowest price of X' gives a concrete trigger, and it notes narrowing via category_id and the natural follow-up ('Next: kh_product'). There is no explicit when-not-to-use or named alternative tool, which keeps it short of a 5.

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