Skip to main content
Glama

Taiwan Market Open Data (Unofficial)

Get dataset rows

dataset.get
Read-onlyIdempotent

Fetch rows from a TWSE OpenAPI or TAIFEX OAS dataset. Find the dataset_id with dataset.search first; do not guess it, since each metric lives in its own table. Supports server-side filtering (code is an exact match; match and where), sorting, field selection and paging: 30 rows by default, 200 at most. For rankings and screens (top 10 by dividend yield, P/E below 10) use where and sort_by instead of paging through rows. Most daily tables hold the previous trading day's after-close data, not live prices; the response note states the period. Data is republished under Taiwan's Open Government Data License. 取得證交所或期交所資料集內容,支援伺服器端過濾、欄位投影與分頁。上游每個資料集都是整份回傳(可能上萬筆),這支工具預設只回前 30 筆(上限 200);用 code/match/where/fields 縮小到需要的範圍。排名與篩選(殖利率最高的前 20 檔、本益比低於 10 的股票)用 where + sort_by,不要自己翻頁比大小。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNo證券/基金/契約代號,例如 "0050"、"TX"。一律精確比對(不分大小寫),實際用了哪個欄位會回在 code_field_used。找不到完全相符的代號時回 0 筆,並在 code_candidates 給出拼法相近的代號——**那些是候選不是答案**,可能是不同商品(MXF 與 MXFFX 是不同契約),請確認後改用該代號重查,不要直接引用它們的數字。
limitNo回傳筆數上限(硬上限 200)。
matchNo其他欄位的子字串過濾,例如 {"基金類型": "ETF"}。最多 20 個欄位。
orderNo"desc"(大到小,預設)或 "asc"。desc
whereNo數值條件,全部都要成立。例如本益比低於 10、殖利率至少 5%:[{"field":"PEratio","op":"lt","value":10},{"field":"DividendYield","op":"gte","value":5}]。欄位值會去逗號轉數字;空值或非數字(例如虧損公司的本益比)無法比較,會被排除並回報筆數。
fieldsNo只回傳這些欄位。
offsetNo分頁位移。
sort_byNo依這個欄位排序,在分頁之前做——要「前 N 名」就用它配 limit。多數值是數字就依數值排,否則依字串排;空值與非數字一律排最後。
dataset_idYes資料集代號,例如 "exchangeReport/STOCK_DAY_ALL"。

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
noteYes
offsetYes
sourceYes
summaryYes
returnedYes
dataset_idYes
rows_matchedYes
rows_in_sourceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / where / items / properties / field / description
      Added value: +"欄位鍵名(dataset.describe 列出的鍵名),例如 \"PEratio\"。"
    • addedInput schema / properties / where / items / properties / op / description
      Added value: +"比較方式:gt 大於、gte 大於等於、lt 小於、lte 小於等於、eq 等於、ne 不等於。"
    • addedInput schema / properties / where / items / properties / value / description
      Added value: +"要比較的數值。"
  2. Added

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, openWorld), yet the description adds genuinely new behavior: the 30-row default vs 200 hard cap, that upstream returns the entire table (possibly tens of thousands of rows) so filtering is server-side, that most daily tables hold the previous trading day's after-close data, that the response note states the period, and the licensing terms.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The English portion is front-loaded and tight, and the Chinese section is not pure duplication — it adds the upstream-returns-everything detail. However the bilingual restatement makes the block longer than strictly necessary for a reader of either language, so it is efficient but not maximally economical.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter tool with nested objects, enums, and an output schema, the description supplies everything an agent needs: prerequisite step, filtering/sorting strategy, paging defaults and caps, and the data-freshness caveat. Return-value shape is rightly left to the output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents every parameter in detail (exact-match code semantics, where operators, limit caps, sort_by behavior). The description only restates this at a higher level ('code is an exact match; match and where') without adding syntax or format meaning beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource (fetch rows from a TWSE OpenAPI or TAIFEX OAS dataset) and distinguishes itself from siblings by naming dataset.search as the required prerequisite for obtaining dataset_id. An agent can tell what this does and how it relates to dataset.describe/dataset.search without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use guidance ('find the dataset_id with dataset.search first; do not guess it'), an explicit alternative path ('for rankings and screens use where and sort_by instead of paging through rows'), and a freshness caveat telling the agent not to treat results as live prices. Nothing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.