Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
BCS_CONFIRMNoОтключает elicitation-подтверждение сделок (по умолчанию включено; выключать не рекомендуется — песочницы нет)
BCS_OUTPUT_DIRNoКорень для файловых выгрузок outputPath (по умолчанию — cwd сервера)
BCS_ALLOW_TRADINGNoРегистрирует place/edit/cancel_order. Нужен токен «для торговли и чтения». РЕАЛЬНЫЕ деньги!
BCS_REFRESH_TOKENYesRefresh-токен из ЛК БКС (90 дней, привязан к счёту)

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}
completions
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_portfolioA

Portfolio of the account bound to the token: every position (securities, money, metals) with quantity, average/current price, value in RUB/USD/EUR, unrealized and daily P&L, portfolio share, accrued interest for bonds. Includes totals by instrument type. The API reports each position once per settlement term (T0/T1/T2/T365) — by default a single slice is returned and totals cover only it; term=all returns the raw duplicates (totals then count every position several times). csv output writes the positions array.

get_limitsA

Account limits: money limits per currency with computed free (= quantity − locked, summarized in freeByCurrency), securities (depo) limits, futures holdings and limits. Note: the API returns a start-of-day snapshot (see loadDate) in a single T365 slice — not intraday. Zero rows are hidden unless includeZero=true.

get_discountsA

Margin discount rates per instrument from the marginal-indicators service. The API exposes discountLong only (no short rates), and values are raw BCS coefficients — observed as 1 for every instrument, so verify against the web cabinet before relying on them. Optional tickers filter is applied client-side.

find_instrumentA

Instrument cards by tickers (batch) or ISINs: name, type, boards (classCode/exchange — classCode is needed by candles/orders), lot size, ISIN, issuer; for bonds — face value, maturity, coupon rate/frequency, accrued interest; for stocks — dividend yield, sector, EPS growth, credit rating, BCS score. Start here to resolve a ticker before other calls. By default one merged card per instrument is returned (primary board; other listings in otherBoards; off-exchange rows flagged offExchange) — pass allBoards=true for the raw per-board cards.

get_instruments_by_typeA

Tradable instruments of a type, paginated (page/size, max 100 per page). Pass outputPath to fetch ALL pages into a file; without it a single page is returned inline. baseAssetTicker is required for type=OPTIONS.

get_trading_scheduleA

Trading sessions of an instrument for the current day: session types with start/end times in MSK (+03:00), sorted. Intervals with tradingSessionStatus=OPEN are the periods when trading is on.

get_trading_statusA

Current trading session status per instrument: session type, OPEN/CLOSE, time of the next status change. Each row is cross-checked against today's schedule; on mismatch a warning + scheduleSaysNow field is added (the upstream status endpoint has been observed reporting CLOSE during an open evening session).

get_candlesA

OHLCV candles. timeFrame: M1/M5/M15/M30/H1/H4/D/W/MN. The API caps one request at 1000 bars; inline calls return the most recent ~1000 TRADING bars of the range (truncated flag set when the range was not fully covered). Pass outputPath to fetch the FULL period via chunked requests (streamed to disk, deduplicated, with progress). Bond prices are quoted in % of face value, not currency.

get_quotesA

Real-time quotes for up to 100 instruments: bid/offer, last price, day open/close/high/low, change. classCode is resolved via find_instrument when omitted. Bond prices are quoted in % of face value, not currency. Note: your own positions already carry currentPrice in get_portfolio.

get_order_bookA

Order book (L2 depth of market) for one instrument: bids/asks with prices and quantities, total volumes. Bond prices are quoted in % of face value, not currency. Outside the trading session the API may report 404 "no data".

get_recent_tradesA

Anonymized recent trades feed for one instrument: time, side, price, quantity, volume. Returns the newest limit trades, fetched hour-by-hour backwards from to (the BCS backend caps one request at a 1-hour period and ~4 MB response). Optional from/to select an explicit window. IMPORTANT: the API serves trades of the CURRENT UTC DAY only (from 00:00 UTC = 03:00 MSK) — earlier window starts are clamped, yesterday is unavailable. Records carry no trade id: identical rows within the same second are genuine distinct trades, not duplicates. Pass outputPath to dump a period (default: the whole current UTC day) to a file via hour-by-hour windows. Bond prices are quoted in % of face value, not currency.

get_ordersA

Your orders on the account (data since 2026-01-26): ticker, side, type, quantity/filled, price, orderStatus (cancelled/filled/active), timestamps. Paginated (page/size), optional date and ticker filters; with outputPath ALL pages are dumped to a file. Orders rejected before reaching the exchange do NOT appear here — check them via get_order_status by client UUID.

get_tradesA

Your executed trades on the account (data since 2026-01-26): ticker, side, quantity, price, volume, trade time (tradeDateTime, MSK). Paginated (page/size), optional date and ticker filters; with outputPath ALL pages are dumped to a file. Note: trades only — cash operations (dividends received, fees, deposits) are not available in BCS Trade API.

get_order_statusA

Status of one order by ID. orderIdType 1 = client UUID (from place_order), 2 = exchange order number in the form YYMMDD-CLASSCODE-NUMBER with a 6-digit date (e.g. 260501-TQBR-79628540663).

get_server_infoA

Server diagnostics for support/feedback reports: version, runtime, mode flags (trading/confirmation), output root. No broker API calls, never includes tokens.

Prompts

Interactive templates invoked by user choice

NameDescription
portfolio_reviewПолный обзор: структура, концентрация, риски, сравнение с целевыми долями
rebalance_checkДрейф от целевых долей и план сделок в лотах (без исполнения)
invest_cashDCA-докупка: распределить свободный кэш к целевым долям, без продаж
bond_pickerСкрининг каталога облигаций под сумму и горизонт: рейтинг, купон, простая доходность, лесенка
fire_progressПрогресс к финансовым целям (FIRE) из portfolio-target.json: прогноз, зазор, требуемый взнос
position_deep_diveГлубокий разбор одного инструмента: карточка, динамика, моя позиция
trades_reviewМои сделки за период: обороты, средние цены, комиссии
feedbackСформировать репорт о проблеме: диагностика сервера, шаги воспроизведения, точные ошибки → feedback/*.md
weeklyДайджест недели + распределение пополнения (если указана сумма)
quarterlyОбзор портфеля + проверка ребалансировки

Resources

Contextual data attached and managed by the client

NameDescription
portfolio-target-exampleОбразец файла целевых долей и финансовых целей для slash-команд (rebalance_check, invest_cash, ритуалы). Скопируйте в корень проекта как portfolio-target.json.

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/human-turn/bcs-mcp'

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