Skip to main content
Glama

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

ashare_agent_search

一句话取数 + 证据链:把「宁德时代最近资金流入怎么样」这种自然语言问题,直接映射到我们自己的数据端点,返回一行结构化数据 + 完整证据(value_hash / source_endpoint / params / as_of),并可核验。 ⭐ 与 ashare_evidence 的分工:ashare_evidence 是公告/资讯/研报原文检索(关键词搜);本工具是把问句变成数据查询(资金流 / 行情 / 公告)。问'多少/怎么样/是什么'用这个;问'发了什么公告/有什么新闻'用 evidence。 ⭐ 返回 = 行数组(data)+ 顶部 citations[] + verification[]: · data[] 是扁平表,一行 = 一条证据(rank / source_endpoint / field_path / value / value_hash / as_of / authority_score) · citations[] 是完整引用(含 params 原对象,可拿它 + field_path 重新取值核对) · verification.claims[] 是逐条裁决(supported / unverified 等)—— ⭐ 这是本产品与同类最大的差别:明确告诉你哪些已验、哪些没验 ⚠️ interpreted.intent_source 必须看:llm = 模型理解;rules_fallback / local_rules = 退回规则(此时能力受词表限制,复杂问法可能判不出)。 ⭐ readable(可读值):资金流/成交额/成交量这类大数值,每行额外给 readable(如 -14.26 亿元)+ unit + rule(换算规则,可反算回原值)—— 直接引用它,别自己换算(实测 LLM 换算 5 次错 1 次,-1524347183 会算成 1.52 亿)。⚠️ value 仍是数据源原值、一字不改;价格/点位类不换算(readable=null)。 ⭐ number_gate(数字自查):你要据此写一段话时,按其中 rules 自查 —— verbatim(原值)/ unit_convert(换单位)可;derived(涨跌幅/同比/占比这类自行计算的派生量)不可,派生量必须来自数据源。 ⚠️ 覆盖边界(如实告知用户,别乱承诺):支持 A股/港股/美股 的资金流(含 5/10/20 日累计)/ 行情价格 / 公告资讯 / 研报观点 / 龙虎榜 / 大宗交易 / 融资融券,以及多标的对比(「宁德时代和比亚迪哪个资金流入更多」)。⛔ 不支持:板块、大盘统计、技术面(K线/指标/支撑位)、基本面(市盈率/ROE/分红/股东人数)、归因分析(「为什么跌」)、预测与荐股 —— 这些会明确拒答(ok:false + 原因),⛔ 不会拿别的字段凑数。 ⚠️ 取不到对应字段时直接拒答并说明,⛔ 绝不返回'看起来像'的其它指标。 ⭐ scope(数据源范围,可选):ashare(自有数据)· notice,news,report(公告/资讯/研报)· web(网页检索,需 X-LLM-Key)· wechat(微信公众号,同 web + 限定公众号)。网页/微信检索可覆盖我们数据库之外的内容(行业政策、宏观解读、非 A 股公司等),⚠️ 但要客户自己的模型 key(费用由客户承担)。⚠️ 显式传 web/wechat 时只在该通道内找,取不到会如实 ok:false(⛔ 不会退回别的通道凑答案);⛔ 暂不支持 a2b(浏览器渲染)/ xhs / local。 ⭐ 网页/微信检索的行(source_type=web_search):除通用字段外还给 rerank_score(相关性 0~3,≥1.5 为优质)+ quality(good / fair)—— 用它判断这批结果够不够好,别只看条数。 ⭐ 句级定位:网页正文类证据带 start_char / end_char(字符区间),可精确回答'哪一句、第几个字符';end_char 与 value 长度一致,可对账。 ⭐ replay=true(重放对账,可选):额外调一次模型比对输出,结果标 match / non_deterministic / not_replayable / skipped_no_client。⚠️ 模型路径下通常为 non_deterministic(同一输入、输出字节可能不同)—— 这不代表结论不可靠(确定性 ≠ 判断质量)。默认关闭。

Input Schema

NameRequiredDescriptionDefault
qYes自然语言问句:宁德时代最近资金流入怎么样 / 贵州茅台最新股价 / 比亚迪的龙虎榜
recencyNo时效窗口:7d / 24h 等(可选)
max_resultsNo证据条数上限(默认 10,上限 50)

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior5/5

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

With no annotations present, the description carries the full behavioral burden and does so in detail: refusal semantics (ok:false + reason, never substitute another field), channel isolation when scope=web/wechat and the requirement of a customer-supplied X-LLM-Key with the cost borne by the caller, the degraded-capability warning tied to interpreted.intent_source=llm vs rules_fallback, and the replay non-determinism caveat. It also discloses a subtle correctness trap — value is the verbatim source value while readable is the safe-to-quote conversion — and forbids derived quantities not present in the source.

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 purpose statement is front-loaded and correct, but the body is roughly 700 words for a 3-parameter tool, dense with ⭐/⚠️/⛔ markers increasing emphasis without increasing information. Several points are re-stated (refusal behavior appears twice, the readable-conversion rule is repeated) and a large block re-documents the return structure. Most sentences do carry real guidance, so this is bloat rather than filler, but it is well past the size the task warrants.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a natural-language-to-query tool with a large result envelope, the description covers what an agent actually needs to act correctly: domain coverage, refusal behavior, per-row quality thresholds (rerank_score ≥1.5 = good), and how to quote values safely. Because an output schema exists, the long walkthrough of data[]/citations[]/verification[] is largely redundant and displaces information the description genuinely lacks, such as the undocumented recency format. The result is complete on policy but over-explained on returns.

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

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline would be 3, but the description spends several paragraphs on `scope` and `replay=true` as though they were call arguments, and neither exists in the input schema. That is actively misleading: an agent following the text will pass scope=web or replay=true and be rejected, while the real parameters (recency, max_results) get no explanation beyond their schema strings. The valuable semantic content it does add (max_results caps evidence rows, q accepts full sentences) is already in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line names a specific transformation: natural-language question → our own data endpoint, returning a structured row plus evidence fields (value_hash / source_endpoint / params / as_of). It explicitly separates itself from ashare_evidence (keyword search over announcements/news/research) which is a genuinely useful sibling distinction. What it does not do is distinguish itself from the many structured siblings that answer the same questions directly (ashare_fund_flow, ashare_quote, ashare_lhb, ashare_news), so an agent still cannot tell when the NL wrapper beats a typed endpoint.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a concrete, actionable routing rule: "问'多少/怎么样/是什么'用这个;问'发了什么公告/有什么新闻'用 evidence" — a real when-to-use vs. when-to-use-other statement. It also enumerates supported domains and, unusually, an explicit not-supported list (sectors, market stats, technicals, fundamentals, attribution, prediction) with the promise of ok:false refusal rather than substituting fields. The gap is that it never tells the agent when to prefer a specific typed sibling over this wrapper, and the routing rule only covers one of ~70 siblings.

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