divar-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DIVAR_MCP_PROXY | No | Optional HTTP proxy for every request to api.divar.ir. The server ignores system proxy variables; set this to use a proxy, e.g. http://host:port. | |
| DIVAR_MCP_STATE | No | Optional path to the state file used for saved watches and price history. Defaults to ~/.divar-mcp/state.json. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| dv_categoriesA | The Divar category tree (236 nodes, up to 4 levels): slug, Persian name, path and whether it is a leaf. Use to find the |
| dv_filtersA | Every filter a category supports: key, type, Persian label, unit and the allowed options. Use before dv_search when you need more than price and district. Pass the keys in |
| dv_filter_optionsA | Allowed values of a filter: brand and model keys (161 car brands), districts, or any option list. With |
| dv_suggestA | What Divar's search box would suggest for some text, and which categories the text belongs to. Use to find the right |
| dv_parse_queryA | Turn a plain Persian request into dv_search arguments: city, neighbourhoods, price bounds, category and leftover words. A rule-based helper, not a language model: it finds a city and its neighbourhoods by name, amounts with
میلیارد / میلیون / هزار (with زیر, کمتر از, تا, بالای, حداقل or از ... تا ...), a category from Divar's own guess for the
leftover words, and moves rental words (اجاره, رهن) to the matching rent category. |
| dv_postA | Everything public about one ad: price in Toman, specs, features, description, images, map position, seller type. Prices: |
| dv_postsA | Details of up to 10 ads in one call (compact: specs and one image, description cut at 300 characters). Use to read a shortlist from dv_search. An ad that was removed shows an |
| dv_compareA | Side by side: the price of each ad and only the specs that differ (the identical ones are listed once). Gives |
| dv_sellerA | The seller behind an ad: how many personal and business ads they have, the business card (name, brand_token) and their ads. Use to judge a seller (one flat or fifty cars?) and to list their other ads. For a dealer's whole page call
dv_dealer with the brand_token ( |
| dv_dealerA | A business account's public page: name, active ad count, member since and its first 11 ads. Divar's web API gives only the first batch of a dealer's ads (no paging); search with the dealer's name or use
the ad filters for more. Ads are compact rows (token, title, price, district, age, photos, tag); the ad link is
|
| dv_similarA | Ads similar to one ad: same brand/model (or category) and neighbourhood, widening step by step until enough are found. Divar has no similar-ads endpoint; this searches the ad's own breadcrumb (brand+district, brand, category+district,
category). |
| dv_marketA | Asking-price statistics of a search: min, p10, p25, median, p75, p90, max, mean; split by district and by day. Scans the newest |
| dv_appraiseA | Is an ad's price (or a price you have in mind) high or low compared with similar ads? Percentile, verdict, confidence. With a |
| dv_statusA | Is Divar reachable and how fast: version, a live latency check, caches and local watch state. Call first when other tools fail (it tells a blocked network from a bad argument). The check is one small request to Divar. The server instructions describe the usual tool order (cities and categories, then dv_search, then dv_post). |
| dv_searchA | Search Divar ads in one or more cities by category, text and filters; compact cards, prices in Toman. Card fields are described in the server instructions; |
| dv_countA | 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. |
| dv_cheapestA | The cheapest ads of a search, cheapest first. Skips negotiable ads, placeholder or absurd prices and far-below-median outliers. Divar cannot sort by price, so this scans the newest |
| dv_best_for_budgetA | Within a budget: the best-value ads (furthest below their peers' median) and the most you can get (closest to the budget). Scans the newest |
| dv_find_dealsA | Ads priced well below the median of the same search, without a budget: scored deals, with bait and junk prices removed. Scans the newest |
| dv_new_sinceA | Ads published after a moment, newest first: poll this to watch a search (a new flat, a cheap car) without repeats. Call it, remember |
| dv_exportA | The ads of a search as CSV or JSON lines text, ready to save to a spreadsheet or analyse. Same arguments as dv_search. Columns: token, title, price, deposit, rent (Toman), district, posted (UTC), photos,
seller, info, url. Missing prices are empty. The text is in |
| dv_nearbyA | Ads on the map around a GPS point, nearest first, with coordinates, distance, price chips and a thumbnail. Up to 200 ads per area are available ( |
| dv_citiesA | City ids for a name (1,177 cities; Tehran is 1, Mashhad 3). Returns id, name, URL slug, province id and centre. Use first when you need a |
| dv_districtsA | Neighbourhoods (محله) of one city with ids, centre point and the main streets inside (Tehran has about 450). Use to get the district ids for a |
| dv_neighboursA | Neighbourhoods adjacent to a district, to widen a neighbourhood search to the surrounding area.
|
| dv_locateA | The city, neighbourhood and street address of a GPS point. Gives the city id and district id to use as filters. The street address is only known inside covered areas. Next: dv_nearby for ads around the point. |
| dv_place_searchA | Map autocomplete: turn a landmark or street name into coordinates and a bounding box. Use the returned lat/lon with dv_nearby (ads around a place) or dv_locate. Persian text works best. |
| dv_place_mappingA | Convert old Divar place ids to the current ones (Divar merged and renumbered places). Use when an id from an old link or saved data returns nothing. |
| dv_boundaryA | Neighbourhood borders of a city from Divar's GeoJSON: the city's bounding box, or one neighbourhood's polygon. Without |
| dv_watchA | Save a search and later get only the ads that appeared since the last check; stored in a local file, nothing is pushed.
|
| dv_price_trendA | The median asking price of a search over the days you have checked it: records one point per day in a local file. Divar keeps no price history, so the trend starts with your first call and grows each day you call it again
(a scheduler helps). Each call scans the newest |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| compare_ads | Compare 2-6 Divar ads and say which to pick. |
| best_under_budget | Find the best Divar ads for a budget. |
| appraise_listing | Check whether a Divar ad's price is fair. |
| watch_market | Watch a Divar search for new ads and track its price. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| cities_resource | All 1,177 cities: id, name, slug, province_id. |
| categories_resource | The category tree, flat: slug, name, parent, leaf. |
TDQS
Scored across 31 tools
Most tools have clearly distinct outputs, and the descriptions helpfully clarify boundaries (e.g. search vs count vs export vs cheapest vs market). However, several search-derived analysis tools (dv_cheapest, dv_best_for_budget, dv_find_deals, dv_market, dv_price_trend, dv_appraise) and the watch/new-since pair overlap enough that an agent could still hesitate.
Every tool uses the same dv_ prefix and lowercase snake_case, with readable noun/verb phrases such as dv_search, dv_post, dv_filters, and dv_price_trend. No mixed conventions or casing issues appear.
31 tools is above the 25+ threshold and feels heavy for a single MCP surface, even for a rich marketplace domain. Several tools could be consolidated or made optional subcommands, and some tools (dv_status, dv_place_mapping) are thin relative to the total.
The read/search/analysis lifecycle is well covered: categories, filters, city/district lookup, search, export, details, seller, dealer, price stats, compare, watch, and trend. Gaps are mostly write/account operations such as creating or editing ads, messaging/contact, or deleting saved watches, which may be outside the read-only scope.