Skip to main content
Glama
tw-stock-mcp

tw-stock-mcp

by jiawei-hong

Get institutional investor trading (三大法人)

get_institutional_trading
Read-onlyIdempotent

Retrieve net buy/sell data for Taiwan's three institutional investor groups (foreign, trust, dealer) on TWSE and TPEx stocks, for a single trading day or up to 23 days, including per-stock figures and market-wide rankings.

Instructions

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

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_institutional_trading"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoLast trading date of the period, YYYY-MM-DD. Default: latest available.
daysNoNumber of trading days ending at `date`, e.g. 5 for about a week. Default 1. Do not combine with start.
limitNoRows per ranking. Default 10.
startNoFirst date of the period, YYYY-MM-DD; every trading day from here to `date` is included (max 23). Do not combine with days.
marketNoRestrict rankings or symbol lookup to one market.
rank_byNoGroup to rank by when symbols are omitted. Default "total".
symbolsNoCodes or exact names, e.g. ["2330", "6488", "鴻海"]. Omit for the market summary and rankings.

Output Schema

NameRequiredDescriptionDefault
dateYesLast trading date of the data (same as end_date)
unitYes
notesYes
stocksNo
end_dateYes
start_dateYes
top_buyersNo
unresolvedNo
top_sellersNo
trading_daysYesTrading days actually covered
market_summaryNoTWSE market-wide totals in TWD over the period

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnly/idempotent/openWorld, but the description adds real operational context: exchange publication timing (15:00-16:30 Taipei), the fallback to the most recent published trading day, the 23-trading-day cap, and how figures convert from per-day to period totals with a daily breakdown. It also discloses units (shares vs TWD) and the ranking-by-shares caveat that low-priced stocks rank higher than their value implies.

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?

Dense but front-loaded: identity first, then period handling, then the symbols/no-symbols split, then units and timing caveats. Nearly every sentence carries information, though the single long paragraph would scan faster as short bullets separating input modes from output semantics.

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 7-parameter, zero-required tool with an output schema, the description covers what an agent needs: defaults, the mutually exclusive period options, what changes when `symbols` is supplied, units, ranking behavior, and data freshness. Return-format detail is correctly left to the output schema.

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

Parameters4/5

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

Schema coverage is 100%, so each parameter is already documented; the description still adds interpretive value by mapping user intents ("this month", "recently") onto `start`/`days` and explaining that `symbols` toggles between per-stock net shares and market-wide TWD totals ranked by `rank_by`. The `total_net` composition formula further clarifies how per-stock values relate.

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?

Names a specific resource and scope: net buying/selling by the three institutional investor groups (foreign, trust, dealer) across TWSE and TPEx. It goes beyond the title by enumerating the groups and clarifying that both markets are covered, so an agent can distinguish it from quote, history, or market-index siblings.

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

Usage Guidelines4/5

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

Gives clear in-tool routing: use `start` or `days` for a period (with natural-language mappings like the 1st of the month or Monday), omit them for a single day, and use `symbols` for per-stock figures versus omitting it for market-wide totals. It never names a sibling tool as an alternative, so cross-tool selection 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.