longbridge
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| BIND | No | HTTP server listen address, default 127.0.0.1:8000 | |
| LOG_DIR | No | Directory for rolling log files | |
| TLS_KEY | No | PEM private key file for HTTPS | |
| BASE_URL | No | Public base URL for resource metadata | |
| TLS_CERT | No | PEM certificate file for HTTPS | |
| LONGBRIDGE_HTTP_URL | No | Longbridge API base URL | |
| LONGBRIDGE_LOG_PATH | No | SDK internal log path | |
| LONGBRIDGE_QUOTE_WS_URL | No | Quote WebSocket endpoint | |
| LONGBRIDGE_TRADE_WS_URL | No | Trade WebSocket endpoint | |
| LONGBRIDGE_MCP_CONFIG_DIR | No | Config file directory |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {} |
| resources | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| account_balanceA | Get account cash balance and asset summary. Returns balances[]{currency, total_cash, max_finance_amount, remaining_finance_amount, risk_level, margin_call}. Filter by currency (e.g. "USD", "HKD"). |
| ah_premiumA | Get A/H share premium historical K-line data. Returns items[]{timestamp, open, high, low, close} representing the premium percentage over the given period. |
| ah_premium_intradayA | Get A/H share premium intraday time-share data. Returns items[]{timestamp, premium_rate} showing the intraday A/H premium percentage minute by minute. |
| alert_addA | Add a price alert. condition: price_rise/price_fall (absolute price) or percent_rise/percent_fall (relative %). frequency: once/daily/every. Returns created alert object. |
| alert_deleteA | Delete a price alert by alert_id (numeric string from alert_list). Returns upstream API response on success; errors if alert_id is invalid. |
| alert_disableA | Disable a price alert by alert_id. Use alert_list to find the numeric alert_id. |
| alert_enableA | Enable a price alert by alert_id. Use alert_list to find the numeric alert_id. |
| alert_listA | Get all configured price alerts. |
| anomalyA | Get market anomaly alerts (unusual price/volume changes). market: HK/US/CN/SG. symbol: optional, filter to a specific stock. count: results per page (default 50, max 100). |
| bank_cardsA | List linked withdrawal bank cards for the current account. Returns cards[]{id, bank_name, account_number (masked), currency, status}. |
| broker_holdingA | Get top broker holding data for a symbol (HK stocks only; sourced from HKEX CCASS participant disclosure). |
| broker_holding_dailyA | Get daily holding history for a specific broker (by broker_id) in a symbol (HK stocks only; sourced from HKEX CCASS participant disclosure). |
| broker_holding_detailB | Get full broker holding detail list for a symbol (HK stocks only; sourced from HKEX CCASS participant disclosure). |
| brokersA | Get broker queue (HK stocks only). Map broker IDs to names via participants. |
| business_segmentsA | Get current-period business segment revenue breakdown for a symbol (name, percent, total, currency) |
| business_segments_historyA | Get historical business segment revenue trends (by period and category). |
| calc_indexesA | Calculate financial indexes for symbols. Pass symbols, and optionally indexes (e.g. ["PeTtmRatio","PbRatio","LastDone","TurnoverRate"]). When indexes is omitted or empty, defaults to ["LastDone","ChangeValue","ChangeRate","Volume","PeTtmRatio","PbRatio","DividendRatioTtm","TurnoverRate","TotalMarketValue"]. Returns per-symbol index values. |
| cancel_orderA | Cancel an open order by order_id. Returns plain text "order cancelled" on success; errors if the order is already filled or cancelled. |
| candlesticksB | Get candlestick data (OHLCV). Only symbol is required; period defaults to day, count to 100 (max 1000), forward_adjust to false, trade_sessions to all. period: 1m/5m/15m/30m/60m/day/week/month/year. trade_sessions: intraday/all |
| capital_distributionB | Get capital distribution for a symbol. |
| capital_flowA | Get capital inflow/outflow time series. Returns items[]{timestamp, inflow, outflow, net_flow} for the symbol (same-day data). |
| cash_flowA | Get cash flow records (deposits, withdrawals, dividends). Returns items[]{transaction_type, amount, currency, balance, created_at, remark}. start_at/end_at in RFC3339. |
| companyC | Get company overview. |
| consensusB | Get financial consensus estimates. |
| constituentA | Get the constituents of an index or the asset allocation of an ETF. For an index (e.g. HSI.HK, .DJI.US) returns constituents[]{symbol, name, last_done, change_rate, market_cap, weight}. For an ETF (e.g. QQQ.US, 2800.HK) returns the asset allocation as info[] grouped by asset_type: 1=Holdings (top constituents with code, symbol, holding_detail), 2=Regional (country/region breakdown), 3=AssetClass (stock/bond/cash etc.), 4=Industry (sector breakdown). Each group has report_date and lists[]{name, position_ratio, name_locales}; Holdings groups additionally include code, symbol and holding_detail{industry_name, index_name, holding_type_name}. |
| corp_actionA | Get corporate actions (splits, buybacks, name changes). |
| create_watchlist_groupA | Create a new watchlist group. Optionally pass securities (e.g. ["AAPL.US", "700.HK"]) to pre-populate. |
| dca_checkA | Check whether given symbols support DCA recurring investment. |
| dca_createB | Create a DCA recurring investment plan. frequency: Daily/Weekly/Monthly. day_of_week (Weekly): Mon/Tue/Wed/Thu/Fri. day_of_month (Monthly): 1-28. |
| dca_historyA | Get execution history records for a DCA plan by plan_id. |
| dca_listA | List DCA recurring investment plans. Filter by status (Active/Suspended/Finished) or symbol. |
| dca_pauseA | Pause (suspend) a DCA plan by plan_id. The plan stops executing until resumed. Returns upstream API response. Use dca_resume to restart. |
| dca_resumeA | Resume a suspended DCA plan by plan_id. Resumes automated execution on the configured schedule. Returns upstream API response. |
| dca_statsC | Get DCA investment statistics. |
| dca_stopA | Permanently stop a DCA plan by plan_id. This cannot be undone. To temporarily pause, use dca_pause instead. Returns upstream API response. |
| dca_updateA | Update an existing DCA plan by plan_id. Can change amount, frequency (Daily/Weekly/Monthly), day_of_week (Mon-Fri), or day_of_month (1-28). Returns updated plan. |
| delete_watchlist_groupA | Delete a watchlist group by id (numeric). Set purge=true to also remove its securities from all other groups. |
| depositsA | List deposit history for the current account. Returns items[]{id, amount, currency, status, created_at, updated_at}. states: comma-separated (Pending/Finished/Failed). currencies: comma-separated codes. |
| depthA | Get order book depth for a symbol. Up to 10 price levels. |
| dividendB | Get dividend history. |
| dividend_detailB | Get detailed dividend distribution scheme. |
| estimate_max_purchase_quantityA | Estimate maximum buy/sell quantity for a symbol. Only symbol is required; side (case-insensitive Buy/Sell) defaults to Buy, order_type (case-insensitive) defaults to LO, and price is optional. |
| exchange_rateA | Get exchange rates for all supported currencies. Returns list[]{from_currency, to_currency, rate, timestamp} covering USD, HKD, CNY, SGD and others. |
| executiveA | Get company executive and board member information. |
| filingsA | Get regulatory filings (8-K, 10-Q, 10-K, etc.). Returns items[]{id, title, type, language, filing_date, url} for the symbol. |
| finance_calendarA | Get finance calendar events by category and date range. category: report (earnings + financials) / dividend / split (splits & reverse splits) / ipo / macrodata (CPI, NFP, rate decisions) / closed (market holidays). |
| financial_reportA | Get financial reports (income statement, balance sheet, cash flow). kind: IS/BS/CF/ALL. report_type: af (annual), saf (semi-annual), q1/q2/q3, qf (quarterly full). |
| financial_report_latestB | Get the latest financial report summary for a security. |
| financial_report_snapshotC | Get financial report snapshot: report_desc (text summary), fo_revenue/fo_ebit/fo_eps (actual vs forecast with yoy/cmp), fr_* financial ratios (ROE, margins, assets, cash flow). report: qf/saf/af. |
| financial_statementB | Get financial statements (income statement, balance sheet, or cash flow) for a security. kind: IS/BS/CF/ALL. report: af (annual), saf (semi-annual), qf (quarterly full), q1/q2/q3. |
| forecast_epsB | Get EPS forecast and analyst estimate history. |
| fund_holderA | Get funds and ETFs that hold a given symbol. |
| fund_positionsA | Get current fund positions. |
| history_candlesticks_by_dateC | Get historical candlestick data by date range. period: 1m/5m/15m/30m/60m/day/week/month/year |
| history_candlesticks_by_offsetA | Get historical candlestick data by offset from a reference time. period: 1m/5m/15m/30m/60m/day/week/month/year |
| history_executionsA | Get historical trade executions between dates. Returns executions[]{order_id, symbol, side, quantity, price, trade_done_at}. start_at/end_at in RFC3339. |
| history_market_temperatureB | Get historical market temperature time series. |
| history_ordersA | Get historical orders between dates (excludes today). Returns orders[]{order_id, symbol, side, status, quantity, price, submitted_at}. start_at/end_at in RFC3339. |
| industry_peersA | Hierarchical sub-sector tree for an industry group. Accepts BK counter_id from industry_rank (e.g. BK/US/IN00258). Each node shows stock count, daily change, and YTD change. |
| industry_rankA | Industry ranking list by market (US/HK/CN/SG) and indicator (0=领涨/1=今日走势/2=人气/3=市值/4=营收/5=营收增长率/6=净利润/7=净利润增长率). sort_type: 0=单级 1=多层. Returns items[]{counter_id(BK/US/IN00258), name, chg, lists[]}. Pass counter_id directly to industry_peers. |
| industry_valuationA | Get industry valuation comparison for peers. |
| industry_valuation_distB | Get industry PE/PB/PS valuation distribution. |
| institution_ratingB | Get institution rating summary. |
| institution_rating_detailA | Get detailed historical institution ratings and target price history. |
| institution_rating_historyB | Get institution rating history. |
| institution_rating_industry_rankA | Get peers ranked by institution analyst ratings in the same industry. Paginated. |
| institutional_viewsB | Get monthly institutional rating distribution timeline. |
| intradayA | Get intraday minute-by-minute price/volume data. trade_sessions: "intraday" (default, regular hours) or "all" (include pre-market and post-market) |
| invest_relationA | Get investor relations events and announcements. |
| ipo_calendarB | Show the IPO calendar. |
| ipo_detailC | Show IPO detail for a symbol. |
| ipo_listedA | List recently listed IPO stocks (HK+US). |
| ipo_order_detailA | Show detailed information for a specific IPO order by order_id. |
| ipo_ordersA | List IPO orders (active+history). Filter by symbol, market, or status. |
| ipo_profit_lossA | Show IPO profit/loss summary and per-stock breakdown. period: all/ytd/1y/3y. |
| ipo_subscriptionsA | List IPO stocks in subscription/pre-filing stage (HK+US). |
| macrodataA | Get historical observations for one macro-economic indicator. Use indicator_code from macrodata_indicators; start_date/end_date accept YYYY-MM-DD. Supports offset/limit pagination. |
| macrodata_indicatorsA | List macro-economic indicators. Filter by keyword and country (US/CN/HK/EU/JP/SG). Use the returned indicator_code with macrodata. Supports offset/limit pagination. |
| margin_ratioB | Get margin ratio for a symbol. |
| market_statusA | Get current market trading status for all markets. |
| market_temperatureA | Get current market sentiment temperature. market: HK/US/CN/SG. |
| newsA | Get latest news articles for a symbol. Returns items[]{id, title, source, publish_time, summary, url, related_symbols[]}. |
| news_searchA | Search news articles by keyword. Returns news_list[]{id, title, description, source_name, publish_at (RFC3339), score}. Paginate with score+publish_at_timestamp+id cursors. |
| nowA | Get current UTC time as an RFC3339 string (e.g. "2025-01-15T08:30:00Z"). Use to determine current date/time before making date-based queries. |
| operatingA | Get company operating metrics (HK stocks only). |
| option_chain_expiry_date_listA | Get option chain expiry dates for a symbol (e.g. AAPL.US). Returns expiry_dates[] as "yyyy-mm-dd" strings. Use with option_chain_info_by_date to get strikes and Greeks. |
| option_chain_info_by_dateA | Get option chain for an expiry date. Returns strikePrices[]{strike_price, call{symbol, last_done, iv, delta, gamma}, put{symbol, last_done, iv, delta, gamma}}. |
| option_quoteA | Get option quotes (max 500 symbols). Returns last_done, prev_close, open, high, low, volume, turnover, implied_volatility, delta, gamma, theta, vega, rho, open_interest per symbol. |
| option_volumeA | Get real-time option call/put volume stats for a US stock. Returns {call_volume, put_volume, put_call_ratio, call_oi, put_oi} and top active contracts. |
| option_volume_dailyA | Get daily historical option stats for a US stock. Returns items[]{date, call_volume, put_volume, put_call_vol_ratio, call_oi, put_oi, put_call_oi_ratio}. |
| order_detailA | Get detailed information about a specific order. |
| participantsA | Get HK market participant broker information. Returns participants[]{broker_ids[], name_en, name_cn, name_hk}. Use broker_ids to interpret broker queue data. |
| profit_analysisA | Get portfolio profit and loss analysis summary. start/end: optional date range in yyyy-mm-dd format. Both must be provided together — passing only one returns empty results. |
| profit_analysis_detailA | Get detailed profit and loss analysis for a specific symbol. start/end: optional date range in yyyy-mm-dd format. Both must be provided together — passing only one returns empty results. |
| quant_runA | Run a quant indicator script against historical K-line data on the server. Executes the script server-side and returns the computed indicator/plot values as JSON. Periods: 1m, 5m, 15m, 30m, 1h, day, week, month, year (default: day). The optional input parameter accepts a JSON array matching the order of input.*() calls in the script, e.g. "[14,2.0]". |
| quoteA | Get latest price quotes. Returns per symbol: last_done, prev_close, open, high, low, volume, turnover, change_rate, change_value, trade_status, timestamp. |
| rank_categoriesA | Get rank tab category configurations for the popularity leaderboard. Pass a second_tags key (e.g. |
| rank_listA | Get ranked stock list by leaderboard tab key. key: from rank_categories second_tags[].key (e.g. "hot_all-us", "hot_up-hk", "trade_heat-us"). market: inferred from key suffix (-us/-hk) or pass explicitly. size: results (default 20). |
| replace_orderA | Modify an open order's quantity, price, trigger_price, or trailing params. Returns "order replaced" on success. Only open/pending orders can be modified. |
| screener_indicatorsA | Get all available screener indicator keys with units and default value ranges. Technical indicators include a tech_values field showing available options (e.g. macd_day: {category:[goldenfork,deadcross], period:[day,week]}). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| alert_disable.output_schema | Full JSON Schema output contract for the `alert_disable` tool. |
| alert_enable.output_schema | Full JSON Schema output contract for the `alert_enable` tool. |
| alert_list.output_schema | Full JSON Schema output contract for the `alert_list` tool. |
| anomaly.output_schema | Full JSON Schema output contract for the `anomaly` tool. |
| broker_holding.output_schema | Full JSON Schema output contract for the `broker_holding` tool. |
| broker_holding_daily.output_schema | Full JSON Schema output contract for the `broker_holding_daily` tool. |
| broker_holding_detail.output_schema | Full JSON Schema output contract for the `broker_holding_detail` tool. |
| brokers.output_schema | Full JSON Schema output contract for the `brokers` tool. |
| business_segments_history.output_schema | Full JSON Schema output contract for the `business_segments_history` tool. |
| capital_distribution.output_schema | Full JSON Schema output contract for the `capital_distribution` tool. |
| company.output_schema | Full JSON Schema output contract for the `company` tool. |
| consensus.output_schema | Full JSON Schema output contract for the `consensus` tool. |
| corp_action.output_schema | Full JSON Schema output contract for the `corp_action` tool. |
| create_watchlist_group.output_schema | Full JSON Schema output contract for the `create_watchlist_group` tool. |
| dca_check.output_schema | Full JSON Schema output contract for the `dca_check` tool. |
| dca_history.output_schema | Full JSON Schema output contract for the `dca_history` tool. |
| dca_list.output_schema | Full JSON Schema output contract for the `dca_list` tool. |
| dca_stats.output_schema | Full JSON Schema output contract for the `dca_stats` tool. |
| delete_watchlist_group.output_schema | Full JSON Schema output contract for the `delete_watchlist_group` tool. |
| depth.output_schema | Full JSON Schema output contract for the `depth` tool. |
| dividend.output_schema | Full JSON Schema output contract for the `dividend` tool. |
| dividend_detail.output_schema | Full JSON Schema output contract for the `dividend_detail` tool. |
| estimate_max_purchase_quantity.output_schema | Full JSON Schema output contract for the `estimate_max_purchase_quantity` tool. |
| executive.output_schema | Full JSON Schema output contract for the `executive` tool. |
| finance_calendar.output_schema | Full JSON Schema output contract for the `finance_calendar` tool. |
| financial_report_latest.output_schema | Full JSON Schema output contract for the `financial_report_latest` tool. |
| financial_report_snapshot.output_schema | Full JSON Schema output contract for the `financial_report_snapshot` tool. |
| forecast_eps.output_schema | Full JSON Schema output contract for the `forecast_eps` tool. |
| fund_holder.output_schema | Full JSON Schema output contract for the `fund_holder` tool. |
| fund_positions.output_schema | Full JSON Schema output contract for the `fund_positions` tool. |
| history_market_temperature.output_schema | Full JSON Schema output contract for the `history_market_temperature` tool. |
| industry_peers.output_schema | Full JSON Schema output contract for the `industry_peers` tool. |
| industry_valuation.output_schema | Full JSON Schema output contract for the `industry_valuation` tool. |
| industry_valuation_dist.output_schema | Full JSON Schema output contract for the `industry_valuation_dist` tool. |
| institution_rating.output_schema | Full JSON Schema output contract for the `institution_rating` tool. |
| institution_rating_detail.output_schema | Full JSON Schema output contract for the `institution_rating_detail` tool. |
| institution_rating_history.output_schema | Full JSON Schema output contract for the `institution_rating_history` tool. |
| institution_rating_industry_rank.output_schema | Full JSON Schema output contract for the `institution_rating_industry_rank` tool. |
| institutional_views.output_schema | Full JSON Schema output contract for the `institutional_views` tool. |
| invest_relation.output_schema | Full JSON Schema output contract for the `invest_relation` tool. |
| ipo_calendar.output_schema | Full JSON Schema output contract for the `ipo_calendar` tool. |
| ipo_detail.output_schema | Full JSON Schema output contract for the `ipo_detail` tool. |
| ipo_listed.output_schema | Full JSON Schema output contract for the `ipo_listed` tool. |
| ipo_order_detail.output_schema | Full JSON Schema output contract for the `ipo_order_detail` tool. |
| ipo_orders.output_schema | Full JSON Schema output contract for the `ipo_orders` tool. |
| ipo_profit_loss.output_schema | Full JSON Schema output contract for the `ipo_profit_loss` tool. |
| ipo_subscriptions.output_schema | Full JSON Schema output contract for the `ipo_subscriptions` tool. |
| macrodata.output_schema | Full JSON Schema output contract for the `macrodata` tool. |
| macrodata_indicators.output_schema | Full JSON Schema output contract for the `macrodata_indicators` tool. |
| margin_ratio.output_schema | Full JSON Schema output contract for the `margin_ratio` tool. |
| market_status.output_schema | Full JSON Schema output contract for the `market_status` tool. |
| market_temperature.output_schema | Full JSON Schema output contract for the `market_temperature` tool. |
| operating.output_schema | Full JSON Schema output contract for the `operating` tool. |
| order_detail.output_schema | Full JSON Schema output contract for the `order_detail` tool. |
| rank_categories.output_schema | Full JSON Schema output contract for the `rank_categories` tool. |
| rank_list.output_schema | Full JSON Schema output contract for the `rank_list` tool. |
| screener_indicators.output_schema | Full JSON Schema output contract for the `screener_indicators` tool. |
| screener_recommend_strategies.output_schema | Full JSON Schema output contract for the `screener_recommend_strategies` tool. |
| screener_search.output_schema | Full JSON Schema output contract for the `screener_search` tool. |
| screener_strategy.output_schema | Full JSON Schema output contract for the `screener_strategy` tool. |
| screener_user_strategies.output_schema | Full JSON Schema output contract for the `screener_user_strategies` tool. |
| security_list.output_schema | Full JSON Schema output contract for the `security_list` tool. |
| shareholder.output_schema | Full JSON Schema output contract for the `shareholder` tool. |
| shareholder_detail.output_schema | Full JSON Schema output contract for the `shareholder_detail` tool. |
| shareholder_top.output_schema | Full JSON Schema output contract for the `shareholder_top` tool. |
| sharelist_create.output_schema | Full JSON Schema output contract for the `sharelist_create` tool. |
| sharelist_detail.output_schema | Full JSON Schema output contract for the `sharelist_detail` tool. |
| sharelist_list.output_schema | Full JSON Schema output contract for the `sharelist_list` tool. |
| sharelist_popular.output_schema | Full JSON Schema output contract for the `sharelist_popular` tool. |
| short_trades.output_schema | Full JSON Schema output contract for the `short_trades` tool. |
| statement_export.output_schema | Full JSON Schema output contract for the `statement_export` tool. |
| statement_list.output_schema | Full JSON Schema output contract for the `statement_list` tool. |
| stock_positions.output_schema | Full JSON Schema output contract for the `stock_positions` tool. |
| submit_order.output_schema | Full JSON Schema output contract for the `submit_order` tool. |
| top_movers.output_schema | Full JSON Schema output contract for the `top_movers` tool. |
| topic_create.output_schema | Full JSON Schema output contract for the `topic_create` tool. |
| topic_create_reply.output_schema | Full JSON Schema output contract for the `topic_create_reply` tool. |
| topic_detail.output_schema | Full JSON Schema output contract for the `topic_detail` tool. |
| trading_days.output_schema | Full JSON Schema output contract for the `trading_days` tool. |
| update_watchlist_group.output_schema | Full JSON Schema output contract for the `update_watchlist_group` tool. |
| valuation.output_schema | Full JSON Schema output contract for the `valuation` tool. |
| valuation_comparison.output_schema | Full JSON Schema output contract for the `valuation_comparison` tool. |
| valuation_history.output_schema | Full JSON Schema output contract for the `valuation_history` tool. |
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/longbridge/longbridge-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server