Skip to main content
Glama

Count matching ads

dv_count
Read-onlyIdempotent

Count active Divar ads matching a search to size markets, test narrow filters, or compare cities and districts before fetching listings.

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, to test whether a filter combination is too narrow, or to compare cities and districts before fetching ads. Same arguments as dv_search.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityNoCity name or id; several comma-separated, e.g. 'تهران', 'mashhad', 'تهران,کرج'.تهران
queryNoFree text in title or description, e.g. 'پراید 111'.
recentNoPublished within '3h', '12h', '1d', '3d' or '7d'.
filtersNoOther category filters (keys from dv_filters): {'size': {'min': 80, 'max': 120}, 'rooms': ['دو'], 'parking': true}. Unknown keys are returned in `ignored`.
categoryNoCategory slug or Persian name, e.g. 'light' (cars), 'apartment-sell', 'apartment-rent', 'mobile-phones'.
districtsNoNeighbourhood names or ids in the one city, e.g. ['ونک'].
has_photoNoOnly ads with photos.
max_priceNoToman; monthly rent in rent categories.
min_priceNoToman; monthly rent in rent categories.
brand_modelNoVehicles, phones: brand/model, e.g. ['پژو 206'].
max_depositNoRent categories: deposit (ودیعه) in Toman.
min_depositNoRent categories: deposit (ودیعه) in Toman.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive and open-world, so safety is covered. The description adds genuinely new behavior: the 10,000 cap and its '10,000 or more' semantics, and that the call is cheap. It does not explain cost/latency beyond 'cheap' or the exact return shape.

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 tight sentences; the most surprising and decision-relevant fact (the cap semantics) is front-loaded in parentheses. No filler sentences.

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 still conveys the essential return semantics (a count, saturated at 10,000) and the nested filters object is documented in the schema. An agent can call this correctly; only finer return details (e.g. whether `ignored` keys are echoed) are left implicit.

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% across 12 params, so the schema already documents each field exhaustively. The description only points to dv_search for argument parity, adding no syntax or format detail beyond the schema. Baseline 3 applies.

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 (count) and resource (active ads matching a search), plus the key scope qualifier that the result is capped at 10,000. The closing note 'Same arguments as dv_search' immediately separates it from that sibling without opening either schema.

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?

Gives three explicit use cases (size a market, test whether a filter combination is too narrow, compare cities/districts) and explicitly positions it as a pre-step 'before fetching ads' — i.e. route to dv_search for actual listings. When-to-use and the alternative are both named.

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