Skip to main content
Glama
tw-stock-mcp

tw-stock-mcp

by jiawei-hong

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

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

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
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 types.

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 events_coverage). Each part states its own date: margin data is published around 21:00 Taipei, so during the trading day it is usually one trading day behind the quote. Use this first when asked about a specific stock; call the individual tools only for more detail (e.g. get_history for a longer window). Sections that fail to load are null and explained in warnings; the rest are still returned.

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 summary already gives the highest, lowest and median of every metric, so no arithmetic is needed. Returns are price returns between end-of-day closes, not adjusted for dividends, stock dividends or splits. Each starts at the last trading day on or before the same date 1, 3 or 12 months before the latest close; as_of gives the dates every source covers, per market. Margins are year to date through margins_period, as Taiwan income statements are cumulative. Prices are TWD. Accepts codes ("2330", "6488.TWO") or exact names ("台積電"). Inputs that cannot be resolved are listed in unresolved with suggestions. A missing value is null with the reason in notes; a source that failed is named in warnings and the rest is still returned. End-of-day data only: use get_quote for intraday prices, get_stock_overview for one stock in depth.

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. volume is the day's accumulated volume in lots (1 lot = 1,000 shares), or shares when odd_lot is true, for the regular session only: end-of-day tools such as get_history report the exchange's daily total, which also includes odd-lot, after-hours fixed-price and other trades, so it is usually a few percent higher. price is null when there has been no trade yet; check status and the best bid/ask instead. Inputs that cannot be resolved are listed in unresolved with suggestions rather than failing the whole call. Outside trading hours (09:00-13:30 Asia/Taipei, weekdays) the last session's values are returned with status "previous_session". ETF quotes (TWSE and TPEx) also carry nav: the issuer's estimated NAV (預估淨值), premium_percent of price against it (positive = premium, negative = discount) and the previous business day's NAV. The estimate comes from the TWSE MIS ETF disclosure feed, which issuers update during the session on their own schedule (the exchange's page refreshes every 15 seconds) and leave at their last value after the close, so check nav.date and nav.time. For ETFs whose underlying trades outside Taiwan hours (underlying_zone not "domestic"), the estimate may not move during the Taiwan session. ETN quotes (codes 020xxx, e.g. 020020 or 02001L) carry indicative_value instead: the issuer's estimated indicative value (預估指標價值), premium_percent of price against it and the previous business day's value, from the TWSE MIS ETN disclosure feed, with the same timing caveats.

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 range (1m, 3m, 6m, 1y, 3y, 5y, 10y back from today) or start/end dates. Day and week bars cover at most 366 days; month and year bars cover up to 10 years back from today. Bars default to daily for windows up to about 3 months, weekly up to a year and monthly beyond; pass interval to override. Up to 366 days, bars aggregate daily data, and moving averages and indicators are computed on daily data (week/month/year bars carry the value at their end_date). Over 366 days (basis "monthly_statistics" or "yearly_statistics"), bars come from the exchanges' monthly or yearly statistics at about one request per year: whole calendar periods with high, low, average_price, volume, turnover and trades but no open; month bars have no close, year bars carry each year's last close. Moving averages and indicators are not available there. summary gives the change from reference_close (the close of the last trading day before the window, as "how did it do this month" means), high/low with dates and volume totals. Units are normalised across both exchanges: prices in TWD, volume in shares, turnover in TWD. Dates are Asia/Taipei. Data is end-of-day and updates after the close (about 14:30 Taipei); use get_quote for intraday prices.

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 include: "balance_sheet" (latest quarter's assets, liabilities, equity, debt ratio, current ratio, ROE and ROA, both year-to-date and annualised), "dividends" (recent dividend resolutions with cash and stock per share, and ex-dividend days since January of last year) and "profile" (company profile: industry, listing and founding dates, paid-in capital in TWD, chairman, general manager, website, full and English names; no business description is published). They are left out unless asked for. Only the latest month of revenue is published; there is no revenue history. ETFs and some securities have no fundamentals; such inputs are listed in unresolved. Sources: TWSE / TPEx OpenAPI, refreshed daily (valuation, profile) to monthly/quarterly (revenue, financials); ex-dividend days from the TWSE / TPEx websites.

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 start (e.g. the 1st of the month for "this month", the Monday for "this week") or days (number of trading days, e.g. 5 for "recently"), up to 23 trading days; figures then become totals over the period, with a daily breakdown per stock. With symbols: per-stock net shares for each group. Without symbols: the TWSE market-wide buy/sell totals in TWD plus the top net buyers and sellers (stocks and ETFs, both markets) ranked by rank_by. All per-stock figures are in shares (positive = net buy); total_net = foreign_net + trust_net + dealer_net. Rankings are by shares, so low-priced stocks rank higher than their TWD value suggests. With symbols and streak: true, each stock also gets streaks: for foreign, trust, dealer and total, the current run of consecutive trading days of net buying or net selling that ends on end_date (「外資連買 N 天」), with its net shares. Weekends and holidays do not break a streak; a day with zero net (no institutional trades) does. The lookback is 20 trading days, so a streak that reaches it has at_least true ("≥ 20 days"). It costs up to 19 more end-of-day requests per exchange, shared by all symbols and stopping as soon as every streak has ended. Without date, the period ends on the most recent trading day with published data; exchanges publish after the close, around 15:00-16:30 Taipei.

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 start (e.g. the 1st of the month for "this month") or days (number of trading days, e.g. 5 for "recently"), up to 23 trading days; buys, sells, redemptions and offsets become totals, previous_balance is from the first day, balance and limit from the last, and each stock gets a daily series. With symbols: per-stock figures. Without symbols: market-wide totals per exchange, including 融資金額 (margin loan amount, TWD), plus the stocks and ETFs with the largest balance increases and decreases ranked by rank_by. Share counts are in shares (the exchanges' lots x 1000) and amounts in TWD. The latest day's balance is provisional: the exchanges finalise it as the next day's previous_balance. Rankings are by shares, so low-priced stocks rank higher than their TWD value suggests. Optional include: ["sbl"] adds 借券賣出 (short sales of borrowed shares, SBL) next to 融券 for each stock and market: sold, returned, adjustment, balance and the next day's SBL sell limit, plus total_short_balance (融券 + 借券賣出) so short interest is complete. rank_by "sbl" ranks by the 借券賣出 balance change and implies the include. It costs one more request per exchange per day. Without date, the period ends on the most recent trading day with published data; the exchanges publish in the evening, around 21:00 Taipei, later than prices and institutional trading.

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 symbols: per-stock figures. Without symbols: each exchange's totals with their published share of market volume and turnover, plus the most day-traded stocks and ETFs ranked by rank_by. Share counts are in shares and amounts in TWD. volume_percent = volume / total_volume x 100, where total_volume is each exchange's end-of-day total (odd-lot trades included), the same figure get_market_movers and screen_stocks report. Ranking by "percent" only considers stocks that traded at least 1,000,000 shares. sell_first_suspended marks stocks where sell-first day trading is suspended (e.g. the 5 trading days before a book closure). Securities not eligible for day trading (e.g. 全額交割 stocks) are listed in unresolved. Brokers can correct a day's figures until two trading days later (T+2), when the exchanges publish the final numbers. Without date, uses the most recent trading day with published data; the exchanges publish it in the evening, Taipei time. One day per call: for a trend, call once per date.

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 symbols, kinds and a date window; events whose period overlaps the window are included. Default window: 14 days ago to 45 days ahead; giving only start or end keeps the other default. Each exchange dataset covers only a limited period, reported in coverage per kind and market: attention notices are for the latest trading day only, dispositions are recent announcements, ex-dividend schedules run a few weeks ahead, and holidays cover only the calendar year TWSE currently publishes. No event outside a dataset's from/to range means no data, not that nothing happened.

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 intraday for a sampled minute-by-minute series of TAIEX and TPEX for the current or last session. Outside trading hours (09:00-13:30 Taipei) it returns the last session with status "previous_session". For daily TAIEX or TPEX history over a date range, use get_index_history.

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 range (1m, 3m, 6m, 1y back from today) or start/end dates (max 366 days; one request per month, so split longer periods into several calls). Bars default to daily for windows up to about 3 months and weekly beyond that; pass interval for week, month or year bars aggregated from daily data. Values are index points. The index pages publish no volume or turnover; use get_market_overview for a day's market turnover. Data is end-of-day and updates after the close (about 14:30 Taipei); use get_market_index for live values and FRMSA.

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 date, uses the most recent trading day with published data.

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 min_turnover (TWD) such as 100000000 to focus on actively traded names. Without date, uses the most recent trading day with published data (published around 14:30-15:00 Taipei). For intraday prices use get_quote.

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 sort_by (default turnover, descending). Price filters use the latest (or given) trading day; fundamental filters always use the latest published snapshot, so date cannot be combined with them. Flow metrics use the same trading day as prices, so they work with date: foreign_net, trust_net, dealer_net and institutional_net are 外資 / 投信 / 自營商 / 三大法人 net buys in shares (negative = net sell; a stock no institution traded counts as 0), and margin_change / short_change are the day's 融資 / 融券 balance changes in shares (stocks not eligible for margin trading have none). For example {"sort_by": "trust_net"} lists the stocks investment trusts bought most, {"sort_by": "foreign_net", "order": "asc"} those foreign investors sold most, {"min_foreign_net": 1, "min_trust_net": 1} those both bought, and {"sort_by": "margin_change"} those whose margin balance grew most. Flows are in shares, so low-priced stocks rank higher than their TWD value suggests. Without date, a flow metric moves the default day back to the latest one whose flows are published (institutional around 15:00-16:30, margin around 21:00 Taipei). industry keeps only the given exchange industries (exact Chinese names such as "半導體業", from the companies' current profiles).

Prompts

Interactive templates invoked by user choice

NameDescription
stock_briefBrief on one Taiwan stock: snapshot, 3-month trend, institutional flows and upcoming events.
market_close_briefEnd-of-day brief on the Taiwan market: indices, breadth, sectors, movers and institutional flows.
compare_stocksSide-by-side comparison of 2 to 10 Taiwan stocks: returns, valuation, growth, margins and flows.

Resources

Contextual data attached and managed by the client

NameDescription
market_holidaysTaiwan 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.
securitiesActive 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_tseActive 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_otcActive 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

A4.4/5.0

Scored across 16 tools

Disambiguation4/5

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.

Naming Consistency5/5

All 16 tools follow a consistent snake_case verb_noun pattern: get_*, compare_stocks, screen_stocks, search_security. No mixed conventions or vague names.

Tool Count4/5

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.

Completeness4/5

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.

Maintenance

ActivityMaintained
ResponsivenessOutdated data