feat(tools): add 6 stock-detail tools - #43
Merged
Conversation
hogan-yuan
marked this pull request as draft
May 12, 2026 13:53
hogan-yuan
force-pushed
the
feat/stock-detail-tools
branch
2 times, most recently
from
May 14, 2026 07:26
3a4bf25 to
b085e85
Compare
hogan-yuan
marked this pull request as ready for review
May 14, 2026 07:29
…nal views, industry rank/peers, earnings snapshot - fundamental: business_segments, business_segments_history, institutional_views, industry_peers, financial_report_snapshot - market: industry_rank (with BK counter_id → IN00xxx.MARKET conversion) - counter: bk_symbol_to_counter, bk_counter_to_symbol - locales: zh-CN/zh-HK entries for all 6 new tools Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Cursor Directory approved: https://cursor.directory/plugins/longbridge - README/server.json: 127 → 133 tools - toolCategories: fundamental 16→19, market 9→10 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Host header was being forwarded to upstream causing 400 Bad Request. Also exclude content-type, accept, authorization, mcp-session-id and other headers that must not cross the MCP-server↔upstream boundary. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ndicator/sort_type/limit)
…e/limit as strings
…onse structure New API returns fo_revenue/fo_ebit/fo_eps + fr_* financial ratios instead of ai_summary/peer_companies/forecast_data
hogan-yuan
force-pushed
the
feat/stock-detail-tools
branch
from
May 15, 2026 02:21
b085e85 to
72f1829
Compare
- industry_peers: accept BK counter_ids (BK/US/IN00258) directly, or symbol (IN00446.US) — same logic as terminal CLI - industry_rank: preserve counter_id in response alongside symbol so callers can pass it directly to industry_peers - counter.rs: remove bk_symbol_to_counter / bk_counter_to_symbol (BK counter_ids are now passed through directly) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- industry_rank: clarify counter_id(BK/US/IN00258) in response, direct passthrough to industry_peers - industry_peers: clarify accepts BK counter_id or symbol, per-node stock_num/chg/ytd_chg Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
transform_json renames counter_id → symbol, so industry_rank output contains IN00258.US instead of BK/US/IN00258. Detect IN-prefix symbols and convert to BK/<market>/<code> directly. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
transform_json renames counter_id→symbol, losing the BK format. Reconstruct counter_id from IN-prefix symbols so callers can pass it directly to industry_peers without any conversion. Also simplify industry_peers: BK counter_id or IN-prefix symbol both work, IN detection is now only needed as fallback. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…bk_counter_ids Use raw HTTP response to preserve BK counter_ids as-is. Removes the pointless counter_id→symbol→counter_id round-trip. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
hogan-yuan
added a commit
that referenced
this pull request
Jul 6, 2026
## Summary Implements 6 new tools from `docs/stock-detail-mcp-prompt.md`: | Tool | Path | |------|------| | `business_segments` | `GET /v1/quote/fundamentals/business-segments` | | `business_segments_history` | `GET /v1/quote/fundamentals/business-segments/history` | | `institutional_views` | `GET /v1/quote/ratings/institutional` | | `industry_rank` | `GET /v1/quote/industry/rank` | | `industry_peers` | `GET /v1/quote/industries/peers` | | `financial_report_snapshot` | `GET /v1/quote/financials/earnings-snapshot` | ### Details - `counter.rs`: added `bk_symbol_to_counter` / `bk_counter_to_symbol` for `IN00xxx.US ↔ BK/US/IN00xxx` conversion - `industry_rank`: recursively converts BK `counter_id` fields to `symbol` in response - `locales`: zh-CN and zh-HK entries added for all 6 tools - `cargo test locales_match_live_tool_schema` ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements 6 new tools from
docs/stock-detail-mcp-prompt.md:business_segmentsGET /v1/quote/fundamentals/business-segmentsbusiness_segments_historyGET /v1/quote/fundamentals/business-segments/historyinstitutional_viewsGET /v1/quote/ratings/institutionalindustry_rankGET /v1/quote/industry/rankindustry_peersGET /v1/quote/industries/peersfinancial_report_snapshotGET /v1/quote/financials/earnings-snapshotDetails
counter.rs: addedbk_symbol_to_counter/bk_counter_to_symbolforIN00xxx.US ↔ BK/US/IN00xxxconversionindustry_rank: recursively converts BKcounter_idfields tosymbolin responselocales: zh-CN and zh-HK entries added for all 6 toolscargo test locales_match_live_tool_schema✅🤖 Generated with Claude Code