Skip to main content
Glama
tw-stock-mcp

tw-stock-mcp

by jiawei-hong

Compare Taiwan stocks side by side

compare_stocks
Read-onlyIdempotent

Compare 2-10 Taiwan stocks (TWSE and TPEx) side by side in one call for price returns, valuation, revenue growth, margins and foreign ownership, with highs, lows and medians summarized.

Instructions

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "symbols": "<symbols>"
    },
    "name": "compare_stocks"
  }
}

Input Schema

NameRequiredDescriptionDefault
marketNoOnly accept stocks on this market. Omit to detect each automatically (recommended).
symbolsYesCodes or exact names, e.g. ["2330", "2454", "鴻海", "6488"]. 2 to 10.

Output Schema

NameRequiredDescriptionDefault
as_ofYesWhat each source covers, for each market compared. null when the source was unavailable or had nothing for these stocks.
notesYesHow the figures are measured, the dates used, and why a value is null
stocksYesOne row per resolved stock, in input order.
summaryYesPer metric (the row fields): the highest and lowest stock with its value, the median and how many stocks have a value. Higher is not always better: a lower P/E or P/B means cheaper, not worse.
warningsYes
unresolvedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.1

TDQS

A4.6/5.0
Behavior4/5

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

Beyond readOnly/openWorld/idempotent annotations, it discloses that cost does not scale with symbol count, that returns are unadjusted price returns, that margins are year-to-date, that prices are TWD, and how partial failures surface via warnings/notes/unresolved. Rich behavioral detail; only rate limits or latency characteristics are absent, and those are minor here.

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: purpose and the cost/efficiency argument come first, then caveats, then routing to siblings. Every sentence carries information, though the block is long enough that a reader has to work through several clauses before reaching the get_quote handoff.

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 multi-metric comparison tool with an output schema, the description covers input resolution, edge-case semantics (nulls, warnings, unresolved), and the data-model caveats (unadjusted returns, cumulative margins) that would otherwise cause misinterpretation. Nothing an agent needs to call it correctly is missing.

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 the baseline would be 3, but the description adds real meaning: accepted symbol syntax ('2330', '6488.TWO', exact Chinese names), that unresolved inputs are echoed with suggestions, and that omitting market auto-detects. It clarifies resolution behavior the schema cannot express.

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 (compare), resource (2-10 Taiwan stocks), scope (mixing TWSE and TPEx) and enumerates the exact metrics returned. An agent can immediately tell what it produces and how it differs from single-stock siblings.

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?

Explicitly says to use this instead of calling get_stock_overview or get_fundamentals per stock, and closes by routing intraday needs to get_quote and single-stock deep dives to get_stock_overview. Both the when and the when-not are named with alternatives.

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