MCP server for Chinese A-share financial statements: pull, cross-check, peer-compare. 把 A 股财报变成 LLM 工具调用。
ashare-mcp demonstrates solid financial domain expertise with 5 well-named tools that follow verb_noun conventions. However, significant gaps exist in parameter descriptions, output schema documentation, and error handling. All tools have descriptions (50-200 chars is ideal; these average ~150), and input schemas are properly declared with JSON Schema types. The critical weakness is that output schemas are documented only in docstrings (not in the schema definition itself), parameter descriptions lack constraint details, and error handling provides no recovery guidance. This is typical of domain-specialized tools that prioritize API coverage over LLM usability patterns.
同业 N 家公司同年年报横向对比,自动算排名 / 最大最小 / 均值 / 标准差,加派生指标 ROE。
跑财务勾稽校验,检测三大表数据是否互相自洽。返回每条校验的 passed/failed/skipped 状态与误差。
拉取 A 股某只股票某年的年报三大财务报表(资产负债表 / 利润表 / 现金流量表)。
把本地 PDF / DOCX / PPTX / 图片(招股书、研报、年报扫描件等)用 opendatalab/MinerU 解析成 LLM-ready 的 markdown,可选附带 content_list JSON(带 bbox / page_idx 的结构化版本)。
拉某只 A 股最近 N 年的多 metric 时间序列,并自动算 YoY / CAGR / mean/std/trend / 异常突变。
Output schemas documented only in docstrings, not in formal schema definitions. LLMs cannot extract output structure from text descriptions, they need typed field definitions. compare_peers docstring describes a complex nested 'companies' array and 'summary' object, but this is not machine-readable.
Parameter descriptions lack actionable constraints. 'year' is described as 'year(整数),如 2024' but does not specify valid range (e.g. 2000-2024), minimum/maximum, or what happens if the year has no annual report. 'metrics' parameter in compare_peers says 'optional' and 'defaults to...' but does not explain what happens if the agent passes an unknown metric name.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 56 | <=2025-11-25 | v2 |
No error handling guidance. Docstrings explain the happy path but do not document failure modes: What if the stock code is invalid? What if the year has no data? What if akshare API is down? The exception clause in server.py logs the error but does not provide the LLM with recovery instructions (e.g. 'Try normalize_stock_code() or validate year >= 2000').
compare_peers stock_codes parameter accepts 'an array' but describes no validation. Code comment says 'single次 most 20 个,超限直接报错' (max 20, reject if exceeded), but this constraint is only in a comment, not in the parameter description where the LLM can see it. No enum for metrics, agents can hallucinate metric names.
parse_document 'lang' parameter is described as '文档语言('ch' / 'en' / ...),默认 'ch'', but 'lang' is a string, not an enum. An LLM might pass 'chinese', 'Chinese', 'chn', or other variants instead of the expected 'ch'. Define as enum: ['ch', 'en'].
Result size caps not declared. get_three_statements returns entire balance_sheet/income_statement/cash_flow_statement objects, no mention of typical field count or if there is a limit. compare_peers 'companies' array could contain up to 20 objects with nested 'values' and 'ranks' dicts, no guidance on result token cost or pagination.
parse_document 'file_path' parameter does not validate path traversal. Docstring says 'absolute or ~ path' and supports .pdf/.docx/.pptx etc., but no mention of symlink handling, network paths, or what happens if the path is invalid. File I/O tools should sanitize input.