Skip to main content
Glama
tw-stock-mcp

tw-stock-mcp

by jiawei-hong

Get market index history

get_index_history
Read-onlyIdempotent

Retrieve daily OHLC history for TAIEX or TPEX indices over a chosen window, with moving averages and technical indicators for trend analysis.

Instructions

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.

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_index_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoLast date, YYYY-MM-DD. Default today.
indexNoDefault "TAIEX".
rangeNoWindow ending today. Default "1m". Do not combine with start.
startNoFirst date, YYYY-MM-DD.
intervalNoBar size. Default: "day" up to ~3 months, else "week". Week, month and year bars aggregate daily data.
indicatorsNoTechnical indicators of daily data, with standard parameters: "rsi" (RSI 14, Wilder), "macd" (MACD 12, 26, 9), "kd" (Taiwan stochastic KD 9, 3, 3), "bollinger" (Bollinger Bands 20, 2σ). Earlier data is loaded so values start at the first bar.
moving_averagesNoSimple moving averages of daily closes, e.g. [5, 20, 60]. Earlier data is loaded so values start at the first bar.

Output Schema

NameRequiredDescriptionDefault
endYes
barsYes
nameYes
indexYes
notesYes
startYes
marketYesExchange that publishes the index
summaryYesNull when there were no trading days in the window. change and change_percent (index points and percent) are measured from reference_close (the last close before the window, dated reference_date), not from first_close.
intervalYes

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 the readOnly/idempotent/openWorld annotations, it discloses real operational traits: end-of-day data that refreshes after the close around 14:30 Taipei, no volume or turnover on index pages, values as index points, and the one-request-per-month limit. The trailing reference to "FRMSA" is unexplained jargon that costs a bit of clarity, but the substantive behavioral disclosure is strong.

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?

Front-loaded with what the tool returns and which index it covers, then constraints, then fallbacks — a sensible order. It is a dense single block that could be broken into a short list of constraints, and the unexplained "FRMSA" tail is dead weight.

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, 0-required tool with an output schema and full annotation coverage, the description covers the remaining gaps an agent needs: data freshness, unit of measure, pagination-style splitting, and sibling routing. Return values are 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 the baseline is 3; the description nonetheless adds meaning the schema lacks — why `interval` defaults change at ~3 months, that week/month/year bars are aggregated from daily data, and that `range` and `start` must not be combined. It does not add much on `indicators`/`moving_averages` beyond what the schema already documents well.

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 and resource — daily OHLC history for the Taiwan headline index — and names the exact instruments (TAIEX/TWSE, TPEX/TPEx) with Chinese names for disambiguation. It also explicitly contrasts itself with get_history (same indicator set, different underlying dataset) and get_market_index (live vs. end-of-day), so an agent can separate it from siblings on purpose alone.

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 concrete when-to-use rules: pick `range` or `start`/`end` (max 366 days), split longer periods into one request per month, and route to get_market_overview for turnover and get_market_index for live values. Both the selection conditions and the alternatives are named, leaving little to inference.

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