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 个月),不支持 北交所 / 期货 / 外汇。只读查询;按收盘更新。⚠️ 免费 / 匿名档按 5 分钟刷新;付费档实时(每次取此刻最新)。⭐ 要多只的 K 线(自选池 / 一个行业)—— 用 ashare_quote_batch(它返回逐只状态、4 秒拿完 300 只;本工具的 code 虽接受逗号但返回混在一起、缺了哪只算不出来)。⚠️ 匿名单次最多 5 只标的(付费不限)。· 免费工具(无需 Key)· 分钟线除外

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.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: it fixes the adjustment convention (前复权 for daily+, no adjustment for minute; no fq param, don't re-adjust), discloses refresh cadence (5-min free/anonymous vs real-time paid), tier requirements (minute lines need standard ¥29.9), unsupported markets (北交所/期货/外汇), the 5-symbol anonymous cap, and that it's read-only reflecting close. This is far beyond typical behavioral disclosure.

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 is front-loaded and each warning is substantive, but the definition is dense with stacked ⚠️ blocks and repeated tier/adjustment caveats that risk overload. Nearly every sentence earns its place, though some redundancy across the batch/full reiteration could be tightened.

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?

Output schema exists so return values needn't be described, and the description covers everything else an agent needs: adjustment rules, tier and market limits, refresh behavior, multi-symbol caveats, and sibling routing. Nothing material to correct invocation 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 parameters are already documented, but the description adds non-obvious semantics the schema omits: minute lines require both start+end with a ~1-month window, the adjustment is fixed with no fq parameter, and turnover is the % field name shared with quote/snapshot. The code-accepts-commas-but-mixes-results caveat is also added. A small gap keeps it from 5.

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 description states a specific resource (K线) with the exact periods supported (day/week/month/season/year + minute lines) and explicitly distinguishes itself from ashare_quote (current price), ashare_minute (intraday tick), and the batch/full siblings. An agent can route to the correct tool from the first sentence 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?

It gives explicit when-to-use triggers ('走势/最近表现/历史K线/趋势'), when-not-to-use conditions, and names each alternative plus the condition that selects it (current price → ashare_quote, intraday → ashare_minute, minute OHLC candles → this tool's period=m1/m5, multi-symbol → ashare_quote_batch, raw/hfq → kline_batch/kline_full). The distinction between 分时 and 分钟K线 is called out directly.

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