Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
TSETMC_DATA_DIRNoDirectory for storing cached data and saved filters (default: ~/.tsetmc-mcp)
TSETMC_MARKET_HOURSNoOverride market hours, e.g., '09:00-12:30' (default based on Tehran time)
TSETMC_OUTPUT_LIMITNoMaximum number of rows in market_watch output (default: 100)
TSETMC_REQUEST_RATENoMaximum requests per minute to TSETMC (default: 60)
TSETMC_POLL_INTERVALNoPoll interval in seconds for market data refresh (default: 10)

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
search_symbolA

Resolve a Tehran-exchange نماد (symbol) to its instrument code (insCode).

Accepts Persian text; Arabic ي/ك and Persian/Arabic digits are normalized automatically. Use this first when you only know the symbol name. Returns {results:[{ins_code, symbol, name}], meta}.

get_quoteA

Live price snapshot for one symbol (نماد or insCode).

Returns last/closing/open/high/low prices, % change vs. yesterday, traded volume & value, EPS, P/E and base volume. Prices are in Rial. Served from the in-memory market snapshot; check meta.market_open and meta.staleness_seconds to know how fresh it is.

get_order_bookB

Live 5-level order book (صف خرید/فروش) for one symbol.

Each level has bid (تقاضا) and ask (عرضه) price, volume and order count. A heavy imbalance with an empty opposite side indicates a buy/sell queue. Fetched live per call (5 levels is the maximum depth TSETMC exposes).

get_money_flowA

Individual-vs-institutional money flow (حقیقی/حقوقی) for one symbol.

Returns buy/sell volumes and counts split into individual (I / حقیقی) and legal (N / حقوقی), plus legal_net_volume (positive = institutional accumulation). Useful for 'smart money' (پول هوشمند) reads.

get_market_watchA

Filtered/sorted view of the whole market (دیده‌بان) from the live snapshot.

ALWAYS filtered and limited so it never dumps ~700 rows. sort_by ∈ {value, volume, pct_change, last, count}. Optional filters: min_pct/max_pct (percent change), min_volume, min_value, flow (1=Bourse, 2=Farabourse, 4=پایه), symbol_contains. fields projects specific columns (default is a compact set). Returns {rows, returned, matched, truncated, meta}.

screenB

Prebuilt market screens over the live snapshot.

kind ∈ {top_gainers, top_losers, most_active_value, most_active_volume, most_active_trades, market_breadth}. market_breadth returns advancers/ decliners/unchanged counts; the others return a ranked, limited list.

get_index_overviewA

Market 'at a glance' (در یک نگاه): TEDPIX (شاخص کل) and the equal-weighted index — last value and change — plus total market value and state.

get_price_historyA

Daily OHLCV history for one symbol (raw / unadjusted), newest last.

days<=0 means the full available history. Large pulls (or save_csv=True) are written to a CSV file and the response returns {file_path, summary, sample} instead of every row, to protect the context window. Prices in Rial.

market_status_toolA

Is the Tehran market open right now? Returns open/trading-day status, the current Tehran time, the session window, and the current snapshot freshness.

describe_fieldsB

Reference: what each field means and its units. Call once; don't repeat.

run_filterA

Run a custom stock filter over the live market and return matching symbols.

expression is a boolean condition over a symbol's fields. Accepts TSETMC filter syntax — e.g. (ct).Buy_I_Volume-(ct).Sell_I_Volume>0 && (plp)>0 — OR friendly aliases — e.g. net_individual > 0 and change_pct > 0. Call filter_help() first to see all variables (price/volume/eps/pe, حقیقی-حقوقی ct_*, order-book, buy_queue()). Order-book/صف filters enrich a shortlist on demand (capped by enrich_limit). Pass save_as to store the filter under a name for reuse. Returns {rows, matched, returned, normalized, tier, meta}.

run_saved_filterC

Run a previously saved filter OR a built-in preset by name.

Presets include: up_liquid, net_individual_inflow, buyer_power_2x, code_to_code, institutional_accumulation, volume_spike, smart_money_lite, buy_queue, sell_queue. Unknown names return the list of available presets + saved filters.

filter_helpA

Reference for writing filters: all variables (with meanings), operators, functions, the buy_queue()/sell_queue() sugar, built-in presets, and the user's saved filters. Call this before writing a filter so it uses valid names.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/solitraderbusiness/tsetmc-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server