Skip to main content
Glama

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

ashare_index_constituent

指数成分股全量清单(沪深300 / 上证50 / 中证500 / 中证1000 / 科创50 / 创业板指 / 恒生…)。用户问'沪深300有哪些成分股/这个指数包含哪些股票/ETF 底层持有什么'用这个。⚠️ 只有名单(code / name / IndexName),没有权重 —— 权重请用 ashare_etf(kind='持仓')(Top20 带权重)与 kind=详情 的 top20Ratio。⚠️ 不是 ETF 申赎清单:申赎清单(PCG)含权重与现金替代标志,本工具给的是指数编制方的成分名单。⚠️ 只接受指数代码(sh000xxx / sz399xxx / hk*);个股 / ETF 请用 ashare_etf(kind='持仓')。⚠️ 支持港股指数:hkHSI 恒生 / hkHSCEI 国企 / hkHSTECH 恒生科技。⚠️ 一次只查 1 个(逗号多只返回空)。⚠️⚠️ 字段按市场不同,⛔ 不能按同一套键名解析:A 股是 code/name/IndexName;港股是中文键 代码/名称/涨跌幅/成交额(比 A 股多两列)。⚠️ 静态档案(随调仓变化),缓存 1 小时;标准版(¥29.9)及以上。

Input Schema

NameRequiredDescriptionDefault
codeYes指数代码:sh000300 / sh000016 / sh000905 / sz399006 / hkHSI

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden and does so well: it discloses that no weights are returned, that it is a static profile cached for 1 hour, that it requires the ¥29.9+ paid tier, that only one index per call is accepted (comma-separated returns empty), and that output key names differ by market. These are exactly the behavioral traits an agent would otherwise get wrong.

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

Conciseness3/5

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

The core scope and the alternative-tool routing are front-loaded, which is good, but the repeated ⚠️ blocks are verbose and partially redundant (ashare_etf(kind='持仓') is recommended twice; weights are disclaimed twice). The density of warnings is defensible for the failure modes it prevents, but it could be tightened without losing 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 single-parameter lookup with an output schema, this covers everything an agent needs: what it returns, what it does not return, how to get the missing piece, which inputs are valid, and the per-market field-name divergence that would otherwise break downstream parsing. Nothing material 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% with examples already in the schema, so baseline is 3; the description adds real constraint semantics on top — accepted code formats (sh000xxx / sz399xxx / hk*), specific HK index codes, and the single-code-only rule. Minor gap: it does not restate the default or say what happens on an unknown code.

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 concrete verb+resource (full constituent list of an index) and enumerates the supported indices (沪深300/上证50/中证500/科创50/恒生...). It also explicitly distinguishes itself from the nearest sibling, ashare_etf, on both the weight dimension and the ETF-basket dimension.

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?

Names the triggering user questions ('沪深300有哪些成分股/ETF底层持有什么'), states when to use the alternative (weights → ashare_etf(kind='持仓'), top20Ratio), and states exclusions (individual stocks/ETFs → ashare_etf; ETF PCG lists are a different tool). Exclusions and alternatives are both explicit.

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