Skip to main content
Glama

Find cheapest product

kh_find_cheapest
Read-onlyIdempotent

Find the cheapest in-stock cosmetics, skincare, hair care, or perfume products for a keyword, returning a flat list sorted by payable price in Toman.

Instructions

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

complete=false: matches go on past scanned, raise scan. Next: kh_product.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "kh_find_cheapest"
  }
}

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.4.0
    • removedInput schema / properties / category_id / anyOf
      Removed value: -[
      -  {
      -    "maximum": 1000000,
      -    "minimum": 1,
      -    "type": "integer"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • changedInput schema / properties / category_id / description
      Previous value: -"Category id from kh_categories or kh_search, e.g. 145 (moisturizers)."New value: +"Id from kh_categories / kh_search, e.g. 145."
    • addedInput schema / properties / category_id / maximum
      Added value: +1000000
    • addedInput schema / properties / category_id / minimum
      Added value: +1
    • addedInput schema / properties / category_id / type
      Added value: +[
      +  "integer",
      +  "null"
      +]
    • changedInput schema / properties / query / description
      Previous value: -"Product name or keyword, Persian or English, e.g. 'کرم مرطوب کننده' or 'cerave'."New value: +"Persian or English keyword, e.g. 'کرم مرطوب کننده', 'cerave'."
  2. 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
  3. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, open-world, and non-destructive behavior, and the description adds real operational context: results are restricted to in-stock items, ordered by payable price, and capped by a scan window that can be widened when complete=false. It doesn't mention rate limits or exact return fields, but the added value over the annotations is substantive.

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?

Two tight sentences with the core purpose front-loaded and the pagination caveat second. The `complete=false` token is terse to the point of being slightly cryptic, but every sentence carries information.

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 five parameters and no output schema, the description carries the burden of describing results and does so at a high level (a flat list ordered by payable price in Toman). The `complete` field it references is never defined as an output, which is a small gap, but an agent can still call the tool correctly.

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 baseline is 3, but the description adds meaning the schema doesn't: the relationship between the truncated result flag and the `scan` parameter, plus the instruction to raise scan when matches continue past the scanned set. That is genuine semantic guidance beyond the property descriptions.

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 and resource ('Find the cheapest in-stock products'), plus the ordering key (payable price) and currency (Toman), which distinguishes it from the generic kh_search. It does not explicitly contrast itself with kh_search or kh_deals, so it stops short of full sibling differentiation.

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?

'Next: kh_product' gives a workflow handoff and the complete=false note tells the agent how to continue a truncated scan. However, there is no guidance on when to prefer this over kh_search, kh_browse, or kh_deals, so tool selection is only implied.

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