tsetmc-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| TSETMC_DATA_DIR | No | Directory for storing cached data and saved filters (default: ~/.tsetmc-mcp) | |
| TSETMC_MARKET_HOURS | No | Override market hours, e.g., '09:00-12:30' (default based on Tehran time) | |
| TSETMC_OUTPUT_LIMIT | No | Maximum number of rows in market_watch output (default: 100) | |
| TSETMC_REQUEST_RATE | No | Maximum requests per minute to TSETMC (default: 60) | |
| TSETMC_POLL_INTERVAL | No | Poll interval in seconds for market data refresh (default: 10) |
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
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| 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.
|
| 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
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 13 tools
Each tool serves a clearly distinct purpose: reference, market overview, live snapshot, filtering, historical data, order book, etc. Even similar tools like get_market_watch, screen, and run_filter are differentiated by their descriptions (filtered view vs prebuilt screens vs custom filters). No ambiguity in tool selection.
Most tools follow a clear verb_noun pattern (e.g., get_quote, run_filter, search_symbol). However, 'market_status_tool' deviates by placing 'tool' at the end instead of using a verb prefix. This is a minor inconsistency in an otherwise coherent naming scheme.
With 13 tools, the server is well-scoped for a stock market data provider. Each tool adds necessary functionality without redundancy. The count is appropriate for covering quoting, history, order book, screening, filtering, symbols, and market status.
The tool set covers all essential operations for the domain: live quotes, historical data, order book, money flow, market overview, screening, filtering, symbol resolution, and market status. No obvious gaps; reference tools for fields and filters further enhance completeness.