Skip to main content
Glama

Filters of a listing

kh_filters
Read-onlyIdempotent

Lists category, brand, tag, or search filters with sub-categories, brands, colors, attribute facets, IDs, counts, price range, and stock, so users can select filters before browsing products.

Instructions

List the filters of a category, brand, tag or search: sub-categories, brands, colors and attribute facets (skin type, ingredients, ...) with ids and counts, plus price range and stock counts.

Use before kh_browse (brands, colors, facets). Brands are cut to 40 and each group to 25 values (omitted = more); pass group for one in full. price_range is list price (min 0 = out-of-stock).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "kh_filters"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagNoTag slug from kh_deals, e.g. 'festival-js'.
groupNoOnly attribute groups whose name contains this, listed in full, e.g. 'نوع پوست' (skin type).
queryNoKeyword, alone or inside the listing.
brandsNoSlugs from kh_brands / kh_filters (OR), e.g. ['simple'].
category_idNoId from kh_categories / kh_search, e.g. 145.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed21 schema fields changedv0.4.0
    • removedInput schema / properties / brands / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "pattern": "^[A-Za-z0-9._-]{1,80}$",
      -      "type": "string"
      -    },
      -    "maxItems": 10,
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • changedInput schema / properties / brands / description
      Previous value: -"Brand slugs from kh_brands / kh_filters (OR), e.g. ['simple', 'cerave']."New value: +"Slugs from kh_brands / kh_filters (OR), e.g. ['simple']."
    • addedInput schema / properties / brands / items
      Added value: +{
      +  "pattern": "^[A-Za-z0-9._-]{1,80}$",
      +  "type": "string"
      +}
    • addedInput schema / properties / brands / maxItems
      Added value: +10
    • addedInput schema / properties / brands / type
      Added value: +[
      +  "array",
      +  "null"
      +]
    • 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"
      +]
    • removedInput schema / properties / group / anyOf
      Removed value: -[
      -  {
      -    "minLength": 2,
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / group / minLength
      Added value: +2
    • addedInput schema / properties / group / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / query / anyOf
      Removed value: -[
      -  {
      -    "maxLength": 100,
      -    "minLength": 2,
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / query / maxLength
      Added value: +100
    • addedInput schema / properties / query / minLength
      Added value: +2
    • addedInput schema / properties / query / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / properties / tag / anyOf
      Removed value: -[
      -  {
      -    "pattern": "^[A-Za-z0-9._-]{1,80}$",
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • changedInput schema / properties / tag / description
      Previous value: -"Campaign tag slug from kh_deals, e.g. 'festival-js' (pink box)."New value: +"Tag slug from kh_deals, e.g. 'festival-js'."
    • addedInput schema / properties / tag / pattern
      Added value: +"^[A-Za-z0-9._-]{1,80}$"
    • addedInput schema / properties / tag / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  2. Changed9 schema fields changedv0.2.0
    • removedInput schema / properties / brands / title
      Removed value: -"Brands"
    • removedInput schema / properties / category_id / title
      Removed value: -"Category Id"
    • changedInput schema / properties / group / description
      Previous value: -"Return only attribute groups whose name contains this, in full, e.g. 'نوع پوست' (skin type)."New value: +"Only attribute groups whose name contains this, listed in full, e.g. 'نوع پوست' (skin type)."
    • removedInput schema / properties / group / title
      Removed value: -"Group"
    • removedInput schema / properties / query / title
      Removed value: -"Query"
    • changedInput schema / properties / tag / description
      Previous value: -"Collection / campaign tag slug from kh_deals (the part after /tags/), e.g. 'festival-js' (pink box)."New value: +"Campaign tag slug from kh_deals, e.g. 'festival-js' (pink box)."
    • removedInput schema / properties / tag / title
      Removed value: -"Tag"
    • removedInput schema / title
      Removed value: -"kh_filtersArguments"
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "title": "kh_filtersDictOutput",
      -  "type": "object"
      -}New value: +null
  3. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description goes well beyond that by disclosing result truncation ('Brands are cut to 40 and each group to 25 values', `omitted` flag meaning more) and the non-obvious semantics of price_range being list price with min 0 meaning out-of-stock. These are exactly the behavioral traits an agent needs and cannot infer from annotations or schema.

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?

Front-loaded with what the tool returns, then usage and truncation caveats; no filler sentences. The second paragraph is dense and packs truncation limits, the `omitted` semantics, the `group` workaround, and price-range caveats into two clauses, which is efficient but slightly hard to parse.

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?

For a five-parameter, all-optional, read-only listing tool with no output schema, the description fully covers what comes back (ids, counts, price range, stock) and the limits of what comes back, which is the main failure mode for this tool. Nothing an agent needs in order to call it correctly is missing.

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 real meaning on top: `group` is framed as the way to bypass per-group truncation, and price_range/stock counts are explained semantically. It does not add syntax detail for tag/query/brands beyond what the schema already states, so it falls short of a 5.

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?

States a specific verb and resource ('List the filters of a category, brand, tag or search') and enumerates the concrete payload: sub-categories, brands, colors, attribute facets with ids and counts, plus price range and stock counts. It also explicitly positions itself against the sibling kh_browse, so an agent can separate the two without opening a schema.

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?

Gives a clear when-to-use rule ('Use before kh_browse') and a specific escalation path ('pass `group` for one in full'), which tells the agent how to recover truncated facet values. It does not explain exclusions or how it relates to kh_categories/kh_brands, which also surface ids, leaving some sibling-routing ambiguity.

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