Skip to main content
Glama
taux-io

TWSE OpenAPI MCP Server

by taux-io

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
TWSE_MCP_TTLNo資料快取秒數3600
TWSE_MCP_CACHENoswagger 快取位置~/.cache/twse-mcp

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
twse_search_datasetsA

搜尋證交所 OpenAPI 有哪些資料集可用。取資料前先用這個找 dataset_id。

會比對資料集代號、中文說明與欄位名稱。

Args: query: 關鍵字,例如 "ETF"、"基金"、"融資"、"本益比"、"月營收"。留空列出全部。 tag: 依分類過濾,例如 "證券交易"、"公司治理"、"財務報表"、"指數"、"券商資料"。 limit: 最多回傳幾筆(預設 25)。

twse_describe_datasetA

查看某個資料集的完整欄位定義,取資料前用來確認要過濾/投影哪些欄位。

Args: dataset_id: 來自 twse_search_datasets 的代號,例如 "exchangeReport/STOCK_DAY_ALL"。

twse_get_datasetA

取得證交所資料集內容,支援伺服器端過濾、欄位投影與分頁。

證交所每個 endpoint 都是一次回整份資料(可能上千筆),所以務必用 code / match / fields 縮小範圍,不要無條件拉全部。

Args: dataset_id: 資料集代號,例如 "exchangeReport/STOCK_DAY_ALL"。 code: 證券/基金代號,例如 "0050"。會自動偵測該表的代號欄位名稱。 match: 其他欄位的子字串過濾,例如 {"基金類型": "ETF"}。 fields: 只回傳這些欄位,例如 ["Code", "Name", "ClosingPrice"]。 limit: 回傳筆數上限(硬上限 200)。 offset: 分頁位移。

twse_realtime_quoteA

取得盤中即時報價(約 5 秒更新一次)。

OpenAPI 只有前一交易日資料,要當下的價格得走基本市況報導站。 ETF 與上市股票用 market="tse",上櫃用 "otc"。

Args: codes: 代號清單,例如 ["0050", "0056", "2330"]。 market: "tse"(上市)或 "otc"(上櫃)。

etf_snapshotA

一次取得單一上市 ETF 的完整概況:基本資料 + 當日價量 + 定期定額熱度。

合併三張證交所的表並行查詢,比分別呼叫 twse_get_dataset 快也不易出錯。 任何一段查不到都會標成 null 並記在 caveats,不會整個失敗。

Args: code: ETF 代號,例如 "0056"、"0050"、"00878"。 include_realtime: 是否附上盤中即時報價(盤後或休市時可能為空)。

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/taux-io/twse-mcp'

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