iran-bourse-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| IRAN_BOURSE_PROXY | No | HTTP(S) proxy for all requests. System proxy variables are honoured when unset. | |
| IRAN_BOURSE_CDN_URL | No | Override the TSETMC API base URL. | https://cdn.tsetmc.com/api |
| IRAN_BOURSE_TIMEOUT | No | Request timeout in seconds. | 45 |
| IRAN_BOURSE_CODAL_URL | No | Override the Codal search API URL. | https://search.codal.ir/api/search/v2/q |
| IRAN_BOURSE_WEBGW_URL | No | Override the TSE gateway base URL. | https://webgw.tse.ir |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Tehran Stock Exchange (TSETMC / بورس تهران و فرابورس) and Codal data. All tools are read-only.
How to work:
Symbols are Persian (فولاد، خودرو، وبملت). Persian/Arabic letter variants (ی/ي, ک/ك) are both fine.
Start with symbol_overview for a stock; use market_watch / top_movers for the whole market.
To find stocks that satisfy conditions (volume spikes, price patterns over past days, real-money flow, valuation, queues), write a filter for screen_stocks instead of paging through market_watch. screener_reference lists fields.
For the exchange's own rankings (برترینها: block trades, rights, ETFs, options, queues, industries) use top_lists; for who is halted use trading_status; for capital increases and price adjustments by date use capital_calendar; option_chain and futures_market cover the derivatives market.
The commodity and energy exchanges: commodity_market (Iran Mercantile Exchange physical market: steel, copper, petrochemicals, cement; trades and roll-ups) and energy_market (Iran Energy Exchange: oil, gas and petrochemical auctions, electricity). Their traded boards (certificates, forwards, funds, futures) are in top_lists and market_watch.
Prices and values are in RIAL. Dates accept Gregorian (2026-11-03) or Jalali (1405/08/12).
The market trades Saturday-Wednesday 09:00-12:30 Tehran time. Outside that, data is the last session.
Anything marked estimate/estimated is derived by this server, not published by the exchange.
Big payloads are summarised on purpose (trade_summary, order_book_history). Use trades with filters when you really need raw ticks.
This is information, not investment advice.
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 |
|---|---|
| market_statusA | Is the Tehran market open right now, and when does it open next? Tehran time, today's status (open, before_open, after_close, weekend or holiday), the public holiday if any, next_session (skipping weekends and holidays), the next upcoming_holidays, the bourse state and totals (وضعیت بازار). Holidays come from the official calendar of 1405; days the exchange closes without notice are flagged in calendar_check when its own data disagrees. |
| market_overviewC | Index value, equal-weight index, total value/volume/trades and market cap for the market (نمای کلی بازار). |
| indicesB | All indices: total, equal-weight, free-float and every industry index with change % (شاخصها و شاخص صنایع). |
| market_watchA | Whole-market table (دیدهبان بازار) of the exchange's own feed: about 3,700 instruments (shares, base market, funds, bonds, options, futures, rights, commodities) on Bourse and Fara Bourse, filtered, sorted and paged in one call. To find instruments by conditions use screen_stocks. |
| top_moversA | Ranked lists of the live session: top gainers/losers, most traded, buy/sell queues (صف خرید/فروش, confirmed against each symbol's real order
book; about 10 s on a strong day), real-person money inflow/outflow (ورود/خروج پول حقیقی), buyer power.
With date (queues only): the queues at the close of a past session, found from that day's end-of-day table and confirmed against each candidate's
order-book history, with queue size at the close and since when it held (can take 20-40 s on a strong day; repeated calls are fast).
Before 09:00 Tehran time the live lists are empty because the exchange resets the day's data: read |
| industry_summaryB | Per-industry breakdown: traded value, average and cap-weighted change, index effect, queue counts (گروههای صنعتی). |
| index_contributorsB | Stocks pushing the total index up or down the most, in index points (بیشترین تاثیر بر شاخص). |
| market_snapshotB | End-of-day table for every instrument on a past date; ordinary stocks unless security_type says otherwise (تاریخچه کل بازار در یک روز). |
| screen_stocksA | Stock screener (فیلتر نویسی): the filter box of tsetmc.com driven by an expression. Returns only the stocks that pass your condition right now, using today's live values plus up to 60 past trading days (close[1], avg(volume, 20), count(close_pct > 0, 3)) and real/legal money flow, in one call with a validated, safe expression (nothing is executed). |
| screener_referenceA | Fields, functions, ready-made presets and examples for screen_stocks filters. Call it when a filter is rejected or you need a field name. |
| market_holder_movesA | Large holders whose positions changed most over the last 5 reported days, market-wide (تغییرات سهامداران عمده). |
| supervisor_messagesB | Exchange supervisor notices (پیام ناظر): trading restrictions, clarifications, halts. |
| search_symbolA | Find instruments by symbol or name fragment; returns symbol, name, market, board, insCode (جستجوی نماد). |
| symbol_overviewA | One-call dossier for a symbol: identity, quote, order book, real/legal flow, top shareholders, latest Codal filings and supervisor notices. Start here. |
| quoteA | Live/last quote with correct change %, volume, value, VWAP, price limits, ranges, P/E and market cap (قیمت لحظهای). |
| order_bookA | Five-level order book (عمق بازار) with order counts, imbalance and buy/sell queue (صف) detection. |
| order_book_historyA | Intraday order-book evolution rebuilt from every event: sampled depth plus buy/sell queue episodes with peak sizes (تاریخچه صف خرید و فروش). |
| tradesA | Raw tick-by-tick trades (ریز معاملات) with time, price, volume, value. Filter by time and size; prefer trade_summary for analysis. |
| trade_summaryA | Aggregate a day's ticks: intraday bars, VWAP, biggest trades, volume by price level, tick-rule pressure estimate, and a completeness check against official totals. |
| price_historyA | OHLCV price history since listing (تاریخچه قیمت), daily or aggregated to weekly/monthly/yearly bars, optionally back-adjusted for capital increases and dividends. For long ranges prefer granularity='monthly' or 'yearly' over thousands of daily rows. |
| technical_indicatorsA | Technical analysis indicators of one symbol (اندیکاتورهای تکنیکال) from its daily prices: SMA 20/50/200, EMA 12/26, RSI 14 (Wilder), MACD 12/26/9 with signal and histogram, Bollinger 20/2 with %B and bandwidth, ATR 14, stochastic 14/3, OBV trend, volume vs its 20-session average, distance from the 52-week high and low, support and resistance from recent swing lows and highs, recent crosses (MACD/signal, SMA50/SMA200) and a plain-language summary ("RSI 72: overbought", "price above SMA50 and SMA200"). Computed by this server from the exchange's adjusted daily closing prices, not published by the exchange. |
| real_legal_flowB | Real vs legal buying/selling (حقیقی و حقوقی): counts, per-capita, buyer power, net money flow, with daily history. |
| shareholdersA | Major shareholders (سهامداران عمده) with shares, percent and the holder_id for deeper lookups. |
| shareholder_historyA | Dated major-holder snapshots for a symbol with computed changes between snapshots; or, with holder=..., one major holder's position over time and the days it bought or sold (تاریخچه سهامدار عمده). |
| shareholder_portfolioC | Everything else that major holder owns across the market (پرتفوی سهامدار). |
| corporate_actionsA | Capital increases and price adjustments (افزایش سرمایه، تعدیل قیمت) with dates and factors. |
| symbol_statisticsA | Exchange-computed averages and stats for the symbol (e.g. average traded value over 3 months). |
| etf_navC | Fund/ETF issue and redemption NAV vs market price: premium/discount (صدور و ابطال). |
| index_historyA | History of any index (تاریخچه شاخص) in index points, not rial: the total index (شاخص کل) back to 2008, equal-weight, free-float, any industry index such as فلزات or بانک, and the Fara Bourse indices. Rows ascending with close, low, high and daily change %, plus a summary of the whole requested range: change %, highest and lowest close with dates, maximum drawdown, up/down days and a volatility estimate. Days the market was closed are flagged flat and kept out of the statistics. With intraday=true: today's 5-minute path with day high/low and the previous close. |
| index_constituentsA | Member stocks of an index (سهام شاخص) with close, change %, volume, value and each stock's effect in index points on the total index (تاثیر در شاخص, from the exchange), plus totals: members, advancers/decliners, traded value, sum of effects. The exchange publishes no index weights, so market-cap share is only a derived proxy (sort_by market_cap). Effects are for the latest session and are left out, with a note, when the exchange's table does not add up to the index move; for a sector index they are the effect on the total index, not on the sector index. |
| fund_rankingA | Ranking and screening of the investment-fund registry (صندوقهای سرمایهگذاری): about 580 funds of 15 types, not only the exchange-traded ones, with net assets, units, redemption/issue/statistical NAV (ابطال، صدور، آماری), returns over 1 day to 1 year and since inception, portfolio mix (stock/bond/deposit), manager and NAV date. Sort by any return or size, filter by type and minimum net assets. Returns are percent as published, null where the fund is too young. The registry has no ticker: find the traded unit with search_symbol on the fund's name, then etf_nav for its NAV premium. Market-maker and very young funds show extreme returns, so filter them for a fair ranking. |
| top_listsA | The exchange's own best-of tables («برترینها» of tsetmc.com): most trades, biggest traded value or volume, price gainers and losers, last price above or below the close, block trades (معاملات عمده), closing-price-only TAL trades, rights (حق تقدم), ETFs, options and futures by volume or open interest, debt papers, energy and commodity markets, the largest buy and sell queues (برترین تقاضا و عرضه), market-value gainers and losers and industries by traded value, for the Bourse, the Fara Bourse and their sub-markets. Rows keep the exchange's own ranking with stable keys (symbol, close, close_pct, last, trades, volume, value ...; rial). Call it first with list_name='catalogue' to see all lists and the flows each one supports. |
| capital_calendarA | Market-wide corporate-action calendar (افزایش سرمایه و تعدیل قیمت), sorted by date: capital increases with the old and new share count, added shares and increase %, and price adjustments (reference-price cuts around dividends and rights) with the adjustment factor, for the days after today, the days up to today, or both. Forward visibility is short: the exchange lists a share-count change only a few days before it takes effect, and price adjustments only after the fact. Not in this feed: dividend per share, ex-dividend and AGM dates, rights exercise price; they are in Codal letters (use codal_filings). |
| trading_statusA | Which symbols are halted or flagged. 'suspended' lists symbols whose trading is suspended (تعلیق شده) with the exchange's reasons; 'supervision' lists symbols that still trade but are in the suspension process (مشمول فرآیند تعلیق) or under caution (معامله تحت احتیاط); 'state_changes' is the market-wide log of order-entry states (مجاز, ممنوع, محفوظ, متوقف), decoded into what each means; 'symbol_history' gives one symbol's state history with its current supervision status and since when. Reasons are plain Persian lines. |
| option_chainA | Option chain (اختیار معامله) of the Tehran derivatives market: for an underlying ('اهرم', 'شستا', 'وبملت' ...) and expiry, every strike with its call (خرید) and put (فروش) leg - last/close price, bid/ask, volume, value, open interest, change % - plus derived (computed, not published) moneyness ITM/OTM, intrinsic and time value, break-even, bid-ask spread, put/call ratios, top open-interest strikes and an estimated max pain, and on every call the covered-call figures (net cost, return if called or unchanged, annualized, downside protection). For «کاورد کال برج ۹» pass expiry=9. Omit underlying to list the underlyings that have options. Prices are rial per underlying unit, one contract = contract_size units; legs with no trade today show no price; open interest is the clearing house's daily figure. |
| futures_marketB | Futures (آتی) of the Tehran derivatives market (about 16 contracts): last and close price, bid/ask, volume, value, open interest, expiry and days left, plus the basis against the underlying - absolute, percent and an annualised estimate (formula in the notes). Contracts that did not trade today show no price and no basis. |
| commodity_marketA | Iran Mercantile Exchange physical market (بورس کالای ایران: steel, copper, aluminium, zinc, cement, petrochemicals, oil products, bitumen, agricultural goods), straight from ime.co.ir. view='trades' lists a session's offers and contracts: product, producer, hall (تالار), contract type (cash نقدی, forward سلف, credit نسیه; matching مچینگ), delivery date, offered / demand / traded tons, weighted-average closing price with low, high and base price in RIAL PER KILOGRAM, and value in RIAL, with totals by hall and contract type and the top products by value. view='summary' gives IME's roll-ups: value and traded / offered tons per ring, traded value per market (physical, futures, options, financial, certificates), one row per session and IME's dollar rate. Units are in the key names (volume_tons, price_rial_per_kg, value_rial). Without a date the latest session is used; IME trades Saturday to Wednesday, so Thursday and Friday are empty. The trades list leaves out the sub-market and is smaller than the summary: never add them. The exchange-traded boards (gold and saffron certificates, standard forwards, commodity funds, futures) are in top_lists (commodity group) and market_watch (security_type='commodity'). |
| energy_marketA | Iran Energy Exchange (بورس انرژی ایران, IRENEX): physical auctions (liquefied gas, solvents, CSO, hexane, liquid nitrogen and other oil, gas and petrochemical products; domestic and international rings) and the electricity market (standard, free and green power contracts), from the exchange's own site (iee.ir). view='trades' gives each auction's result: product, supplier, ring and destination, contract type, offered / demand / traded volume, base and average price and the exchange's value in RIAL; view='offers' the announced auctions; view='auction' one auction's terms, price units, buy and sell order levels and trades; view='overview' whether the market is open and today's traded value. Units differ by product and are spelled out per row: tonne auctions in rial are priced per KILOGRAM, dollar auctions per TONNE, premium auctions as a premium on a reference price, electricity in kW of capacity over the delivery period with kwh the energy and the price per kWh (see price_basis and totals.volume_by_unit; volumes of different units are never added). Without a date the latest session is used; the exchange trades Saturday to Wednesday. The traded boards (electricity forwards and base-load contracts, capacity and energy-saving certificates, energy futures) are in top_lists (energy group). |
| codal_filingsB | Search Codal disclosures (کدال): title, publish time, tracing number and links to the page, PDF, Excel and attachments. |
| codal_companyB | Issuer profile from Codal: CEO, ISIC, address, activity description (اطلاعات ناشر). |
| codal_letterA | Read the CONTENT of any Codal letter (متن و جدولهای اطلاعیه کدال): financial statements, monthly activity reports, meeting decisions (DPS, capital increases), explanations and notices. Structured reports come back as tables (columns from the report's own headers, numbers parsed, usually million rial: see unit_note), one sheet per call, with the other sheets listed in 'sheets'; a statement sheet also gets 'key_items' (revenue, profits, EPS, assets, equity, cash flows...) and a monthly report a 'monthly_summary' (month and year-to-date sales, by product). Plain letters come back as text. For the usual questions prefer financial_statements, monthly_activity or fundamentals, which find and read the right letters for you. |
| financial_statementsA | A company's financial statements from Codal (صورتهای مالی): income statement, balance sheet and cash flow, each as key items for this period, the same period last year and the last full year (revenue, cost of revenue, gross/operating/net profit, EPS, total assets, equity, debt, cash, operating cash flow, capex, dividends paid...), plus margins, growth, ROE/ROA on trailing twelve months, current ratio and leverage. Banks (loans, customer deposits, loan interest, fee income, loans-to-deposits) and insurers (premiums, claims, technical reserves, loss ratio) are read in their own templates. Amendments and audited re-issues replace earlier versions. Amounts in million rial, EPS in rial. For the full tables of a letter use codal_letter. |
| monthly_activityA | A company's monthly activity reports from Codal (گزارش فعالیت ماهانه، ن-۳۰): sales of each month and year to date, growth on the same span last year, month-on-month change, and for the newest month each product's production, sales quantity, rate and amount (domestic, export and services). Banks give operating income, loans and deposits at the month end and net interest; insurers premiums and claims; investment companies operating income and their portfolio. Amended reports replace the originals. Amounts in million rial. |
| fundamentalsA | One-call fundamental picture of a company (تحلیل بنیادی): price and market cap, the exchange's EPS and P/E, the latest Codal statements (revenue, net profit, EPS, equity), margins, growth, ROE/ROA, liquidity and leverage, valuation computed on trailing twelve months (EPS, P/E, P/S, P/B, marked estimated), and the last three months of sales from the monthly reports. |
| glossaryB | Explain Iranian market terms (صف خرید، سرانه خرید، حقیقی/حقوقی، دامنه نوسان …) so answers use them correctly. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| analyze_symbol | Full analyst-style review of one symbol. |
| daily_market_report | End-of-day market report. |
| find_stocks | Turn a plain-language description into a screen_stocks filter, run it and verify the hits. |
| smart_money_scan | Find symbols where real-person buying power and money inflow stand out. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| glossary_resource | Full Persian/English market glossary. |
TDQS
Scored across 45 tools
The set has many adjacent views: market_watch vs market_snapshot vs screen_stocks vs top_lists, quote vs symbol_overview vs fundamentals, and codal_letter vs financial_statements/monthly_activity. Descriptions often explicitly steer selection, which keeps ambiguity manageable, but an agent still faces several plausible entry points for common questions.
All names use snake_case and cluster into coherent prefixes such as market_, index_, shareholder_, and codal_, making them readable and predictable. The convention is mostly noun-phrase/resource-based with a few verb-led exceptions like search_symbol and screen_stocks, so it is not perfectly uniform.
45 tools is far above the comfortable 3-15 range and creates a large selection surface, even though the domain genuinely spans equities, derivatives, Codal, commodity, energy, and funds. Several tools could be combined or tiered behind higher-level entry points.
Coverage is unusually broad: market status, indices, quotes, order books, trades, fundamentals, Codal, options, futures, commodity, energy, screening, shareholders, and corporate actions. Minor gaps such as DPS/ex-dividend dates are explicitly routed to Codal, so agents have workarounds rather than dead ends.