tw-stock-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Taiwan stock market data from TWSE (上市, market "tse") and TPEx (上櫃, market "otc"). For a question about one stock, start with get_stock_overview; to compare several stocks, use compare_stocks. For the market as a whole, start with get_market_overview (end of day) or get_market_index (intraday). Tools accept codes ("2330") or exact Traditional Chinese names ("台積電"); use search_security for partial names. The market is detected automatically. Prices and amounts are TWD; dates and times are Asia/Taipei. Each tool states its volume unit: get_quote uses lots (1 lot = 1,000 shares), the end-of-day tools use shares. End-of-day tools default to the latest trading day with published data and say which date they used. Data comes from public exchange endpoints and is for information only, not investment advice.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| search_securityA | Find Taiwan-listed securities (TWSE 上市 = "tse", TPEx 上櫃 = "otc") by code or name. Use this to turn a company name such as "台積電" or a partial code such as "233" into a security code before calling other tools. Matches code or Traditional Chinese name; exact matches rank first, then prefix, then substring, with stocks before ETFs. By default searches stock, etf, preferred, etn, other; warrants and convertible bonds (95% of all listings) are excluded unless requested via |
| get_stock_overviewA | Everything about one Taiwan stock in a single call: a short company profile (industry, listing date, paid-in capital), the latest quote, a rolling 1-month price summary, fundamentals (valuation, monthly revenue, latest income statement), the latest day of institutional trading (三大法人), the latest margin balances (融資 / 融券) with their day change, foreign ownership against its legal ceiling, and events from 14 days ago to 45 days ahead (ex-dividend, disposition, attention, halts; attention notices only exist for the latest trading day, see |
| compare_stocksA | Compare 2-10 Taiwan stocks side by side in one call, mixing TWSE (上市) and TPEx (上櫃) freely: latest close, 1M / 3M / 1Y price return, P/E, P/B, dividend yield, latest monthly revenue YoY, gross / operating / net margin from the latest quarterly report, and foreign ownership %. Use this instead of calling get_stock_overview or get_fundamentals once per stock: it reads full-market snapshots, so its cost does not grow with the number of stocks, and |
| get_quoteA | Near-realtime quotes for Taiwan stocks and ETFs from TWSE MIS, covering both TWSE (上市) and TPEx (上櫃). Accepts codes ("2330", "2330.TW", "6488.TWO") or exact Traditional Chinese names ("台積電"); the market is detected automatically. Prices are TWD. |
| get_historyA | OHLCV history for one Taiwan stock or ETF (TWSE or TPEx), with a summary, optional moving averages and optional technical indicators (RSI, MACD, KD, Bollinger Bands). Choose a window with |
| get_fundamentalsA | Latest fundamentals for Taiwan-listed companies (TWSE and TPEx): valuation (P/E, dividend yield, P/B), the latest monthly revenue with MoM/YoY growth, and the latest quarterly income statement with EPS and margins. All amounts are TWD (converted from the exchanges' thousands). The income statement is year-to-date (cumulative from January through the reported quarter), as filed in Taiwan. P/E uses the latest four quarters of EPS, which can lag the income statement (see earnings_period); dividend yield uses the latest annual dividend (see dividend_year and dividend_per_share). Yields above 20% are flagged in warnings because they usually reflect a one-off distribution. Optional sections via |
| get_ownershipA | Ownership structure of Taiwan-listed stocks and ETFs (TWSE and TPEx), up to 20 per call. shareholder_distribution is the TDCC 集保戶股權分散表: holders, shares and percent of TDCC custody shares in each of 15 holding tiers (1-999 shares up to over 1,000,000 shares), plus over_1000_lots (千張大戶), over_400_lots (400張大戶) and up_to_50_lots (50 lots or fewer, usually read as retail); 1 lot = 1,000 shares. TDCC publishes only the latest weekly snapshot (see coverage), so week-over-week changes are not available here. foreign_ownership (外資及陸資持股) is the latest trading day's shares held by foreign and mainland investors, as a percent of issued shares, with the legal ceiling and the room left under it. TPEx publishes it for stocks only, not ETFs. For daily foreign buying and selling use get_institutional_trading. All quantities are shares. If one source is unavailable the other part is still returned and warnings says why. Sources: TDCC open data (weekly), TWSE / TPEx foreign ownership reports (daily). |
| get_institutional_tradingA | Net buying/selling by Taiwan's three institutional investor groups (三大法人): foreign investors (外資), investment trusts (投信) and dealers (自營商), for TWSE and TPEx. Covers one trading day by default. For a period, set |
| get_margin_tradingA | Margin trading (融資) and short selling (融券) for TWSE and TPEx stocks and ETFs: buys, sells, redemptions, balances and limits for each side, 資券互抵 (offset), 券資比 (short/margin ratio) and 融資使用率 (margin utilisation). Covers one trading day by default. For a period, set |
| get_day_tradingA | Day trading (現股當沖) for TWSE and TPEx stocks and ETFs on one trading day: shares day-traded, day-trade buy and sell amounts, and day trading's share of the stock's total volume (當沖比例). With |
| get_market_eventsA | Upcoming and recent events on TWSE and TPEx: market holidays (休市), ex-dividend / ex-rights dates (除權息) with cash dividend per share, disposition stocks under restricted trading (處置股), attention notices for unusual trading (注意股), and trading halts (暫停交易). Filter by |
| get_market_indexA | Near-realtime values of Taiwan's headline indices: TAIEX (發行量加權股價指數, TWSE), TPEX (櫃買指數) and FRMSA (寶島股價指數). Returns value, previous close, change, change percent and the day's open/high/low. Set |
| get_index_historyA | Daily OHLC history of a Taiwan headline index: TAIEX (發行量加權股價指數, TWSE) or TPEX (櫃買指數, TPEx), with the same summary, moving averages and technical indicators (RSI, MACD, KD, Bollinger Bands) as get_history. Choose a window with |
| get_market_overviewA | One-call end-of-day brief of the Taiwan Stock Exchange (TWSE) for a trading day: TAIEX (加權指數) and key indices, sector indices (類指數) ranked by change, market breadth (advancers/decliners, limit up/down), turnover, and institutional investors' net buy/sell in TWD. Use get_market_index for intraday index values (including the TPEx index) and get_market_movers for the stocks behind the moves. Without |
| get_market_moversA | End-of-day ranking of Taiwan stocks and ETFs across TWSE and TPEx: top gainers, losers, or most traded by volume (shares) or turnover (TWD). Defaults to common stocks and ETFs; illiquid names can dominate gainer/loser lists, so set |
| screen_stocksA | Filter all TWSE and TPEx stocks by end-of-day price, change, volume and turnover, and by valuation (P/E, dividend yield, P/B) and monthly revenue growth. Every filter is an optional min_/max_ bound, e.g. {"min_dividend_yield": 5, "max_pe_ratio": 15, "min_turnover": 100000000}. Rows missing a filtered metric are excluded. Defaults to common stocks only; results are sorted by |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| stock_brief | Brief on one Taiwan stock: snapshot, 3-month trend, institutional flows and upcoming events. |
| market_close_brief | End-of-day brief on the Taiwan market: indices, breadth, sectors, movers and institutional flows. |
| compare_stocks | Side-by-side comparison of 2 to 10 Taiwan stocks: returns, valuation, growth, margins and flows. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| market_holidays | Taiwan market holidays (TWSE and TPEx share one calendar) for the year TWSE currently publishes, plus the trading days that open and close the Lunar New Year break. JSON. |
| securities | Active TWSE (上市) and TPEx (上櫃) listings as [code, name, market, type] rows; types are stock, etf, preferred, etn, other. Warrants and convertible bonds are left out (use search_security). JSON. |
| securities_tse | Active TWSE (上市) listings as [code, name, market, type] rows; types are stock, etf, preferred, etn, other. Warrants and convertible bonds are left out (use search_security). JSON. |
| securities_otc | Active TPEx (上櫃) listings as [code, name, market, type] rows; types are stock, etf, preferred, etn, other. Warrants and convertible bonds are left out (use search_security). JSON. |
TDQS
Scored across 16 tools
Tools mostly target clearly distinct datasets (quotes, history, fundamentals, institutional, margin, day trading, indices, events, ownership, screening). There is intentional overlap between get_stock_overview, compare_stocks, get_quote and get_fundamentals, but the descriptions explicitly guide when to use the aggregate versus the detail tools, keeping misselection low.
All 16 tools follow a consistent snake_case verb_noun pattern: get_*, compare_stocks, screen_stocks, search_security. No mixed conventions or vague names.
16 tools is slightly above the typical 3–15 well-scoped band, but each tool maps to a distinct data domain and no tool appears redundant. The count is reasonable for a comprehensive Taiwan stock data server.
The surface covers quotes, historical OHLCV, fundamentals, screening, market movers, institutional/margin/day trading, indices, events, ownership and security search. Minor gaps exist (e.g. dedicated dividend/corporate-action history or ETF composition), but most workflows are handled via overview, fundamentals and events.