Skip to main content
Glama
tw-stock-mcp

tw-stock-mcp

by jiawei-hong

Get daily price history

get_history
Read-onlyIdempotent

Retrieve daily OHLCV history for Taiwan stocks or ETFs from TWSE/TPEx by range or dates, with optional moving averages and summary metrics for trend analysis.

Instructions

Daily OHLCV history for one Taiwan stock or ETF (TWSE or TPEx), with a summary and optional moving averages. Choose a window with range (1m, 3m, 6m, 1y back from today) or start/end dates (max 366 days). Bars default to daily for windows up to about 3 months and weekly beyond that; pass interval to override. summary gives the change from reference_close (the close of the last trading day before the window, as "how did it do this month" means), high/low with dates and average volume. Units are normalised across both exchanges: prices in TWD, volume in shares, turnover in TWD. Dates are Asia/Taipei trading days. Data is end-of-day and updates after the close (about 14:30 Taipei); use get_quote for intraday prices.

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": {
      "symbol": "<symbol>"
    },
    "name": "get_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoLast date, YYYY-MM-DD. Default today.
rangeNoWindow ending today. Default "1m". Do not combine with start.
startNoFirst date, YYYY-MM-DD.
marketNoOmit to detect automatically.
symbolYesCode ("2330", "6488.TWO") or exact name ("台積電").
intervalNoBar size. Default: "day" up to ~3 months, else "week". Week and month bars aggregate daily data.
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
codeYes
nameNo
notesYes
startYes
marketYes
summaryYesNull when there were no trading days in the window. change and change_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. First observedv0.1.2

TDQS

A4.9/5.0
Behavior5/5

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

Although annotations already mark the tool read-only, idempotent, and open-world, the description adds important behavior: end-of-day data updates after roughly 14:30 Taipei, dates are Asia/Taipei trading days, units are normalized, and default aggregation changes with the window length. That is substantial context beyond the structured annotations.

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

Conciseness5/5

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

The description is one dense but well-ordered paragraph: it front-loads the resource and scope, then covers window rules and defaults, then units, freshness, and the intraday alternative. Every sentence carries operational information and there is no filler.

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 seven-parameter market-data tool with an output schema and annotations, it supplies the missing operational context: data currency, exchange coverage, normalized units, timezone, window limits, default bar aggregation, and when to use a sibling tool instead. No material gap remains for correct invocation.

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 description coverage is 100%, so the baseline is 3, but the description still clarifies the maximum 366-day span, range-versus-start/end semantics, interval defaults by window, and the meaning of summary relative to reference_close. Some of that discussion, especially summary and reference_close, concerns output rather than input parameters, which limits the added input-parameter value slightly.

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 OHLCV history,' and narrows scope to one Taiwan stock or ETF on TWSE or TPEx. It also explicitly distinguishes itself from get_quote for intraday prices, so an agent can select it without opening another 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?

Explains how to choose the window with range or start/end, notes the 366-day maximum, describes default daily-versus-weekly bar sizing and the interval override, and explicitly routes intraday needs to get_quote. The when-to-use and alternative guidance is complete.

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