Skip to main content
Glama

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

ashare_kline_batch

⭐ 批量 K 线:一次拿多只股票的 K 线(多只 × 同一段时间),逐只标明成功与否。用户问'这几只的走势/把我这个池子的 K 线拉下来/一个行业最近 60 天表现'用这个。⚠️ 与其它三个 K 线工具的分工:ashare_kline=一只(code 虽接受逗号但返回混在一起、缺了哪只算不出);ashare_kline_full=一只 × 全部历史;ashare_market_kline=某一天 × 全市场;本工具=多只 × 同一段时间(按代码列表驱动)。⚠️ 为什么值得单开一次调用:自己循环 200 只 × 30 根 = 200 次调用 ≈ 2.3 分钟(还会撞限频退避);本工具实测 3.39 秒拿完 6,000 行,200 只全部返回。⚠️ 用法:codes 逗号分隔(sh600519,sz000001),支持裸 6 位码。⚠️ 返回:data 数组,每项 {code, ok, data:[...]}(该只的 K 线数组),取几只回几个条目;同时给 requested / returned / failed。⚠️ count 默认 30(每只各 30 根);fq 可选 qfq/hfq/nofq(留空 = 服务端默认)。⚠️ 字段固定 8 列,换手率叫 turnover(%)。⚠️ 上限:专业版 单次 200 只(不限量 1000);另有总条数 6 万上限(标的数 × count ≤ 60,000,如 200 只 × 300 根触顶)。按实际返回只数计费。⚠️ 付费工具:专业版(¥99)及以上,标准版不可用。

Input Schema

NameRequiredDescriptionDefault
fqNo复权:qfq / hfq / nofq(留空 = 服务端默认)
endNo结束日期 YYYY-MM-DD(可选)
codesYes股票代码,多个用逗号分隔:sh600519,sz000001(专业版 ≤200 只 · 机构版 ≤1000 只)
countNo每只返回几根(默认 30,最大 1212)
startNo起始日期 YYYY-MM-DD(可选)
periodNo周期:day/week/month/season/year 或 m1~m120(默认 day)day

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / codes / description
      Previous value: -"股票代码,多个用逗号分隔:sh600519,sz000001(专业版 ≤200 只 · 不限量版 ≤1000 只)"New value: +"股票代码,多个用逗号分隔:sh600519,sz000001(专业版 ≤200 只 · 机构版 ≤1000 只)"
  2. Added

TDQS

A4.8/5.0
Behavior5/5

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

No annotations exist, so the description carries the full burden and does: partial-failure semantics (per-item ok flag, requested/returned/failed counts), hard caps (200 stocks professional / 1000 institutional; 60,000 total rows = stocks × count), a concrete performance benchmark, per-returned-stock billing, and a paywall (Professional ¥99+ only). These are exactly the traits an agent must know before calling.

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?

The core statement is front-loaded and the ⚠️ sections impose usable structure on a dense block (scope → differentiation → benchmark → params → returns → caps → pricing). It is longer than ideal and slightly redundant (per-item result shape is restated in the returns and caps sections), but nearly every line carries decision-relevant information.

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 6-param batch tool with an output schema, the description still covers the operational envelope: scale limits, cost model, tier gating, failure tolerance, and field naming. Nothing an agent needs in order to call this correctly or to prefer a sibling 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 baseline is 3; the description still adds meaning the schema doesn't — bare 6-digit codes are accepted, count is per-stock (30 each) and interacts with the 60,000-row cap (e.g. 200 × 300 hits the ceiling), and the turnover field name is called out as a return-column gotcha. The only gap is minor: fq/period behavior is left to the schema.

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 title line states a specific verb, resource, and scope: fetch K-lines for multiple stocks over one shared time window, per-stock success flagged. It then explicitly distinguishes itself from all three sibling K-line tools (ashare_kline = one stock, ashare_kline_full = one stock × full history, ashare_market_kline = one day × whole market), so an agent can route without opening 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?

Concrete triggering scenarios are given ('这几只的走势', '把我这个池子的 K 线拉下来', '一个行业最近 60 天表现'), plus an explicit exclusion rule: don't loop ashare_kline yourself because 200 calls ≈ 2.3 min with rate-limit backoff versus 3.39 s here. The alternatives table makes the when-not unambiguous.

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