MCP server for fetching and building auditable financial data packages for A-share and Hong Kong equity securities
The server defines 3 tools with complete input schemas and descriptions. Tool naming follows verb_noun convention (get_, search_, build_). Descriptions are domain-specific and informative (avg 185-210 chars, within baseline 194), but lack explicit guidance on when to use each tool vs. alternatives. All parameters are typed with descriptions. However, output schemas are not documented, tools return TextContent without declaring the structure of the returned text, making it difficult for LLMs to parse results or chain tools. Error handling is minimal: no recovery guidance, no error categorization, no validation of stock codes against expected patterns. Security is adequate (read-only tools, no credentials in parameters), but input validation is not visible in the provided code.
Build an auditable A-share or Hong Kong historical financial research package for financial modeling. It saves separate annual/interim statements, normalized core actuals, all non-empty line items, product/industry/geography composition, financial indicators, share-capital history, dividends, source links, traceable units and currency roles, a manifest, and automated quality checks. For HK stocks it strictly separates HKD quote currency from issuer financial-statement currency using yfinance, does not fetch unresolved Eastmoney monetary statements, and optionally uses the free Futu OpenD login for issuer-disclosed product/geography revenue breakdowns.
Fetch the current market snapshot and recent years of financial data, save them to the specified directory (or current directory by default), and return the local file paths. Supports A-shares (e.g., '600519') and HK stocks in yfinance format (e.g., '0700.HK').
Find the stock code or ticker for a given company name. For A-share companies listed on Shanghai/Shenzhen exchanges use market='cn' (default). For Hong Kong listed companies (港股), you MUST pass market='hk'; otherwise the search will only look in the A-share database and will fail. Examples: '贵州茅台' → cn, '腾讯控股' / 'Tencent' → hk.
Output schema not documented. All tools return TextContent(type='text', text=result) but the structure of 'result' is not specified. LLMs cannot parse multi-line financial data without knowing field names, types, or record boundaries. This violates the response-shaper pattern and forces LLMs to use brittle string parsing.
No error handling or recovery guidance. The code raises generic ValueError() with minimal messages (e.g., 'stock_code string argument is required'). No guidance on retryable vs. fatal errors, no suggestions for corrective actions (e.g., 'Stock code not found, try search_stock() to find the correct code'), and no validation of input format (e.g., 6-digit A-shares, HK ticker format).
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 69 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 49 | - | v1 |
Missing parameter descriptions for the 'market' parameter in search_stock lack guidance on when to use 'cn' vs. 'hk' for ambiguous names. The description states the requirement but does not explain how the LLM should decide for English names like 'Tencent' (is that HK or mainline?). Parameter dependency (name → market selection) is documented in the tool description but not reinforced in param schema.
Tool descriptions are long (210+ chars for build_historical_financial_package) and dense with technical detail ('strictly separates HKD quote currency', 'Eastmoney monetary statements'). While accurate, this overloads the LLM's decision-making. Descriptions should state WHAT (builds financial package), WHEN (modeling, due diligence), and RESULT (auditable package), then push implementation details to param descriptions.
No input validation visible in handler code. Parameters like 'years' and 'include_latest_interim' lack runtime checks, if an LLM passes years=0 or years=15 (outside 3-10), the schema enforces bounds but the code does not reject with actionable error messaging. Same for stock_code format (should be 6 digits for A-shares or .HK format for HK).