Skip to main content
Glama

A股数据 API (A-Share Data API)

ashare_kline

K线(日/周/月/季/年 + 分钟线)。用户问'走势/最近表现/历史K线/趋势'用这个。⚠️ 只要当前价用 ashare_quote;要分时(盘中每分钟价+累计量)用 ashare_minute ——分钟 K 线(OHLC 蜡烛)用本工具的 period=m1/m5/...,两者不是一回事。⚠️ 换手率字段名是 turnover(%)—— 与 ashare_quote、ashare_snapshot 同名同值。⚠️ 复权口径固定:日线及以上前复权(除权除息日不跳空),分钟线不复权 —— 本工具没有 fq 参数,不要再自己复权(会二次复权)。⭐ 要原始价 / 后复权(nofq / hfq):用 ashare_kline_batch(专业版)或 ashare_kline_full(标准版,仅 A 股)—— 复权口径属付费档能力。⚠️ 分钟线需 standard(¥29.9)及以上档位(日/周/月免费),必须同时传 start+end(窗口近 1 个月),⚠️ 北交所 / 期货 / 外汇 / 美股指数没有分钟K线 —— 传这些代码返回 422 明确报错(⛔ 不是空数组);北交所的分钟级数据用 ashare_minute(分时),别重试 kline。只读查询;按收盘更新。⚠️ 免费 / 匿名档按 5 分钟刷新;付费档实时(每次取此刻最新)。⭐ 要多只的 K 线(自选池 / 一个行业)—— 用 ashare_quote_batch(它返回逐只状态、4 秒拿完 300 只;本工具的 code 虽接受逗号但返回混在一起、缺了哪只算不出来)。⚠️ 匿名单次最多 5 只标的(付费不限)。· 免费工具(无需 Key)· 分钟线除外

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": {
      "code": "<code>"
    },
    "name": "ashare_kline"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNo结束日期 YYYY-MM-DD(仅 day 与分钟线;须与 start 配对;分钟线必填)
codeYes股票代码:sh600667
countNo条数(默认 30,最大 1212)
startNo起始日期 YYYY-MM-DD(仅 day 与分钟线;须与 end 配对;分钟线必填)
periodNo周期:day / week / month / season / year / m1 / m5 / m15 / m30 / m60 / m120(默认 day)day

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / properties / fq
      Removed value: -{
      -  "default": "",
      -  "description": "复权:留空=默认(日线 qfq / 分钟线 nofq);可选 qfq / hfq / nofq",
      -  "title": "Fq",
      -  "type": "string"
      -}
  2. Changed1 schema field changed
    • addedInput schema / properties / fq
      Added value: +{
      +  "default": "",
      +  "description": "复权:留空=默认(日线 qfq / 分钟线 nofq);可选 qfq / hfq / nofq",
      +  "title": "Fq",
      +  "type": "string"
      +}
  3. Changed4 schema fields changed
    • changedInput schema / properties / count / description
      Previous value: -"条数(默认 30)"New value: +"条数(默认 30,最大 1212)"
    • addedInput schema / properties / end
      Added value: +{
      +  "default": "",
      +  "description": "结束日期 YYYY-MM-DD(仅 day 与分钟线;须与 start 配对;分钟线必填)",
      +  "title": "End",
      +  "type": "string"
      +}
    • changedInput schema / properties / period / description
      Previous value: -"周期:day / week / month(默认 day)"New value: +"周期:day / week / month / season / year / m1 / m5 / m15 / m30 / m60 / m120(默认 day)"
    • addedInput schema / properties / start
      Added value: +{
      +  "default": "",
      +  "description": "起始日期 YYYY-MM-DD(仅 day 与分钟线;须与 end 配对;分钟线必填)",
      +  "title": "Start",
      +  "type": "string"
      +}
  4. Changed3 schema fields changed
    • addedInput schema / properties / code / description
      Added value: +"股票代码:sh600667"
    • addedInput schema / properties / count / description
      Added value: +"条数(默认 30)"
    • addedInput schema / properties / period / description
      Added value: +"周期:day / week / month(默认 day)"
  5. First observed

TDQS

A4.9/5.0
Behavior5/5

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

No annotations are supplied, so the description carries the full burden and does so thoroughly: read-only, close-based updates, 5-minute refresh on anonymous/free tier versus real-time on paid tiers, hard 5-symbol cap for anonymous callers, fixed adjustment policy (forward-adjusted on daily+, none on minute, with a warning against re-adjusting), and explicit 422 error behavior for unsupported exchanges. These are behavioral facts nowhere in the schema or annotations.

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?

Purpose and sibling routing are front-loaded, and nearly every clause carries a fact (tier gating, 422 behavior, turnover field name, batch alternative). It is dense to the point of being visually noisy with repeated ⚠️/⭐ markers and some redundancy around tiering that could be consolidated, but there is little genuinely empty text.

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?

An output schema exists, so return-value detail is unnecessary, and the description covers everything else an agent needs: tier requirements, required start+end pairing for minute lines, unsupported instrument classes and their error shape, refresh cadence, anonymous limits, and adjustment semantics. The paid-tier alternatives for raw/hfq data close the only remaining gap.

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

Parameters5/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, but the description adds real meaning beyond it: it warns that a `fq` parameter does NOT exist and that self-adjusting causes double adjustment, and it discloses that `code` technically accepts commas but returns merged output with no way to detect missing symbols. Those are non-obvious invocation consequences not inferable from the schema text.

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?

The first sentence names the resource (K线/candlestick series) and its full coverage (day/week/month/season/year plus minute lines) — a specific resource with explicit scope. It then distinguishes itself from ashare_quote (current price only) and ashare_minute (intraday tick), so an agent can tell which of the three to open without reading 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?

Explicit routing rules: '走势/最近表现/历史K线/趋势' → this tool; current price → ashare_quote; 分时 → ashare_minute; multi-symbol → ashare_quote_batch; raw/back-adjusted prices → ashare_kline_batch or ashare_kline_full. It also states exclusions (BSE/futures/FX/US indices have no minute K-line; use ashare_minute instead, don't retry) and the tier prerequisite for minute lines, which is exactly the when-not guidance an agent needs.

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.

Resources