Agent Skillpytse-client
SkillToolsPlaygroundUniverseDocsInstallConsoleEvals

16 tools · JSON schema

Tool catalog

Each tool maps 1:1 onto a pytse-client function. Invoke via the playground, POST /api/tools/invoke, or MCP /api/mcp/call.

universe

all_symbols

Run

List every symbol known to pytse-client (from bundled symbols_name.json plus live appends).

pytse_client.all_symbols()

Pitfall. The bundled JSON can lag newly listed names; Ticker() will still resolve via TSETMC search.

resolve_symbol

Run

Resolve a Persian name to TSETMC index, ISIN-adjacent ids, and old indexes for delisted rows.

pytse_client.download.get_symbol_info(symbol)

script · scripts/resolve_symbol.py

Pitfall. If the name is delisted, pass index= to Ticker() instead of relying on search.

history

download_history

Run

Download daily OHLCV for one, many, or all symbols. Optional Jalali column and split-adjusted prices.

tse.download(symbols, write_to_csv=False, include_jdate=False, adjust=False)

script · scripts/download_history.py

Pitfall. Adjustment uses adjClose vs next-day yesterday. Empty frames are logged and skipped, so the returned dict can be shorter than the input list.

flow

download_client_types

Run

Retail (حقیقی) vs institutional (حقوقی) daily buy/sell counts, volumes, values, and ownership change.

tse.download_client_types_records(symbols, write_to_csv=False, include_jdate=False)

script · scripts/client_types.py

Pitfall. Mean prices are value/vol and can be NaN on zero volume. Some days are missing.

index

download_financial_indexes

Run

Download OHLCV history for TSE financial indexes, or all of them.

tse.download_financial_indexes(symbols, write_to_csv=False, include_jdate=False)

script · scripts/financial_index.py

Pitfall. Names must match indices_name.json keys, which are Arabic-normalized (Arabic kaf ك): شاخص كل, شاخص كل (هم وزن). download_financial_indexes normalizes Persian input; FinancialIndex(symbol=…) does not.

financial_index_snapshot

Run

Live-ish snapshot of an index: last_value, last_update, high, low, history, intraday_price.

tse.FinancialIndex(symbol)

script · scripts/financial_index.py

Pitfall. Intraday table parses parentheses as negatives; commas stripped. Unlike download_financial_indexes, FinancialIndex(symbol=…) does not normalize — the Persian-kaf spelling شاخص کل silently resolves index=None.

ticker

ticker_snapshot

Run

Full Ticker board: title, group, EPS, P/E, NAV, float, market cap, best bid/ask, state, last prices.

tse.Ticker(symbol, index=None, adjust=False)

script · scripts/ticker_snapshot.py

Pitfall. Funds have NAV; producers have PSR. آسام-like names may lack EPS/P/E. Constructor downloads history.

ticker_realtime

Run

Five-level live book plus last trade, state, and حقیقی/حقوقی trade summaries.

ticker.get_ticker_real_time_info_response()

script · scripts/ticker_snapshot.py

Pitfall. RuntimeError fires only for deactivated/delisted symbols (current index listed in old[]). Halted symbols (ممنوع-متوقف etc.) still return a board — read .state.

ownership

ticker_shareholders

Run

Current major shareholders table. Float ≈ 100 - sum(percentage).

ticker.shareholders

script · scripts/ticker_snapshot.py

Pitfall. Percentages are major holders only; true free float also uses ticker.float_shares.

ticker_shareholders_history

Run

Daily major-holder history. Slow. Do not parallelize across symbols.

ticker.get_shareholders_history(from_when, to_when, only_trade_days=True)

Pitfall. TSETMC bans IPs that hammer this. Inside a running loop use get_shareholders_history_async. 500s are retried.

ticker_total_shares_history

Run

Async history of share count (capital increases).

await ticker.get_total_shares_history_async(from_when, to_when, only_open_days=True)

Pitfall. Must be awaited. Default lookback in docs is 60 days.

intraday

ticker_trade_details

Run

Last trading day's tick tape for a symbol (time, volume, price).

ticker.get_trade_details()

Pitfall. This is last session only. For a date range use module-level get_trade_details.

get_trade_details

Run

Historical ticks or aggregated intraday bars (30s, 1m, 5m, 10m, 15m, 30m, 1h) for a date range.

tse.get_trade_details(symbol, start_date, end_date=None, to_csv=False, timeframe=None, aggregate=False)

script · scripts/get_trade_details.py

Pitfall. Default timeframe=None returns raw ticks and can be huge. With to_csv=True and base_path=None, CSVs land in trade_details_history/.

get_orderbook

Run

Historical five-level order book between two dates. Optional diff-only faster payload.

tse.get_orderbook(symbol, start_date, end_date=None, to_csv=False, ignore_date_validation=False, diff_orderbook=False, async_requests=True)

script · scripts/get_orderbook.py

Pitfall. ignore_date_validation if start/end might not be trading days. async_requests=False is slower.

get_asks_and_bids

Run

Market-wide top-of-book snapshot from MarketWatchInit — no symbol parameter; filter the returned frame by symbol.

tse.get_asks_and_bids(to_csv=False, base_path=None)

Pitfall. Covers only symbols present in the bundled symbols_name.json. Values are empty outside the trading session.

screener

get_stats

Run

Universe key statistics used for TSETMC filter-writing: averages, client types, market-watch fields.

tse.get_stats(base_path=None, to_csv=False)

script · scripts/get_stats.py

Pitfall. Some fields are missing for some names; market watch parse can fail if TSETMC changes layout.