Skip to main content
Glama

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

ashare_margin_trade

个股融资融券明细:融资余额 / 融资买入 / 融资偿还 / 融券余额 / 融券卖出 / 融券偿还。用户问'这只股票杠杆资金在加还是在撤/融资余额多少/两融数据'用这个。⚠️ code 必填(参数上不是 required,但不传只会得到一句明确说明、没有数据)。⚠️ 支持批量:code 可传逗号分隔(sh600667,sz000651),返回多行 —— 但不带逐只状态,缺了哪只要自己算。⚠️ date 留空 = 最近已披露交易日(两融数据 T+1 披露,当天查不到当天的);未披露的交易日会给出明确原因。⚠️ 与 ashare_fund 的关系:ashare_fund 一次给『资金 + 龙虎榜 + 大宗 + 两融』四块概览;本工具只给两融明细、字段更全 ⇒ 只看两融用本工具。⚠️ ETF 不在两融名单 —— 实测 sh510300 当日与历史日都恒回 NOT_DISCLOSED(文案说'尚未披露',实际是该标的没有两融),⛔ 别当延迟反复重试。

Input Schema

NameRequiredDescriptionDefault
codeNo股票代码(支持逗号批量):sh600667 或 sh600667,sz000651
dateNo日期 YYYY-MM-DD(留空=最近已披露交易日)

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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 it does: it discloses that code is de-facto mandatory despite the schema marking it optional (empty call returns only a message, no data), that batch returns rows without per-symbol status so the caller must reconcile missing codes itself, that data is T+1 disclosed so today is unavailable, and that NOT_DISCLOSED for ETFs means 'not in the margin list' rather than 'delayed' — preventing a retry loop.

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?

Front-loaded with purpose then the when-to-use rule, and every ⚠️ warning carries non-obvious operational content. Slight deduction: the code/date warnings partially restate the schema's own parameter descriptions, so a sentence or two is redundant for an agent that reads the schema.

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 2-parameter read tool with an output schema, the description covers the remaining risk surface: mandatory-in-practice param, batch fan-out semantics, disclosure lag, and a false-negative case (ETF). Nothing an agent needs in order to call it correctly and interpret emptiness 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 description coverage is 100%, so baseline is 3; the description adds real semantics on top — that code is effectively required, the comma-batch syntax with a concrete example, and the T+1/已披露 caveat for date. It goes beyond the schema's terse field descriptions without fully specifying response field types, which the output schema already covers.

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?

Opens with a specific verb+resource ('个股融资融券明细') and enumerates exactly the six fields returned (融资余额/融资买入/融资偿还/融券余额/融券卖出/融券偿还). It explicitly positions itself against the sibling ashare_fund ('ashare_fund 一次给四块概览;本工具只给两融明细、字段更全'), so an agent can discriminate without opening either 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?

Gives concrete triggering user questions ('杠杆资金在加还是在撤/融资余额多少/两融数据'), names the alternative (ashare_fund) with the condition that selects this tool over it, and adds a hard exclusion (ETF 不在两融名单, don't retry sh510300). When-to-use, when-not-to-use, and alternative routing are all present.

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