Skip to main content
Glama

Count matching ads

dv_count
Read-onlyIdempotent

Counts active Divar ads matching a search in one low-cost call, capped at 10,000+; use it to size a market or check whether filters are too narrow before fetching ads.

Instructions

How many active ads match a search, in one cheap call (capped: 10,000 means '10,000 or more').

Use to size a market or to test whether filters are too narrow before fetching ads.

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": "dv_count"
  }
}

Input Schema

NameRequiredDescriptionDefault
cityNoتهران
queryNo
recentNo
filtersNo
categoryNo
districtsNo
has_photoNo
max_priceNoToman; monthly rent in rent categories.
min_priceNoToman; monthly rent in rent categories.
brand_modelNo
max_depositNoRent deposit (ودیعه), Toman.
min_depositNoRent deposit (ودیعه), Toman.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv0.3.0
    • removedInput schema / properties / brand_model / description
      Removed value: -"Vehicles, phones: brand/model, e.g. ['پژو 206']."
    • removedInput schema / properties / category / description
      Removed value: -"Category slug or Persian name, e.g. 'light' (cars), 'apartment-sell', 'apartment-rent', 'mobile-phones'."
    • removedInput schema / properties / city / description
      Removed value: -"City name or id; several comma-separated, e.g. 'تهران', 'mashhad', 'تهران,کرج'."
    • removedInput schema / properties / districts / description
      Removed value: -"Neighbourhood names or ids in the one city, e.g. ['ونک']."
    • removedInput schema / properties / filters / description
      Removed value: -"Other category filters (keys from dv_filters): {'size': {'min': 80, 'max': 120}, 'rooms': ['دو'], 'parking': true}. Unknown keys are returned in `ignored`."
    • removedInput schema / properties / has_photo / description
      Removed value: -"Only ads with photos."
    • changedInput schema / properties / max_deposit / description
      Previous value: -"Rent categories: deposit (ودیعه) in Toman."New value: +"Rent deposit (ودیعه), Toman."
    • changedInput schema / properties / min_deposit / description
      Previous value: -"Rent categories: deposit (ودیعه) in Toman."New value: +"Rent deposit (ودیعه), Toman."
    • removedInput schema / properties / query / description
      Removed value: -"Free text in title or description, e.g. 'پراید 111'."
    • removedInput schema / properties / recent / description
      Removed value: -"Published within '3h', '12h', '1d', '3d' or '7d'."
  2. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

The annotations already declare read-only, idempotent, and non-destructive behavior, so the description's main contribution is the 10,000 cap semantics, which is genuinely useful and prevents misreading a saturated count as exact. However, it says nothing about the default city scope, the open-world coverage, or latency/rate characteristics beyond the vague word 'cheap'.

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?

Two short sentences, front-loaded with the core action and capped in a parenthetical, with the use-case sentence second. Nothing is wasted or redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter tool with a nested object, no output schema, and low schema coverage, the description is far too thin. It should state that the response is a single count value, that the cap is a floor not an exact number (this is covered), and that filters should be reused from dv_search/dv_filters so the agent isn't guessing at parameter meaning.

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

Parameters2/5

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

With 12 parameters and only 33% schema description coverage, the description needs to compensate and does not: it never mentions that filters mirror dv_search, that city defaults to Tehran, what 'recent' accepts, or how the nested 'filters' object relates to the flat parameters. Only max/min price and deposit have schema descriptions, leaving most parameters undocumented anywhere.

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?

The description states a specific verb and resource ('Count ... active ads matching a search') and implies the sibling boundary by contrasting with 'fetching ads'. It never names dv_search, dv_posts, or dv_filter_options, so the distinction is inferable rather than explicit.

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?

It gives two concrete use cases: sizing a market and testing whether filters are too narrow before retrieving ads. That effectively tells the agent when to count instead of fetch, but there is no explicit 'do not use for X' exclusion or named alternative tool.

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