cn-funds-mcp Usage Guide
Tool Quick Reference
Fund Queries
| Tool | Purpose | Key Parameters |
|---|---|---|
search_fund | Search funds (name/code/pinyin) | keyword |
get_fund_estimate | Real-time valuation (intraday estimated NAV and change) | fundCode |
get_fund_batch_info | Batch retrieve NAVs for multiple funds | fundCodes (comma-separated) |
get_fund_info | Fund details (type/company/manager/scale/ranking) | fundCode |
get_fund_valuation_detail | Day's valuation trend (intraday minute-by-minute) | fundCode |
get_fund_net_value_history | Historical NAV trend | fundCode, range |
get_fund_accumulated_performance | Cumulative return vs CSI 300 vs peers | fundCode, range |
get_fund_position | Detailed holdings (stocks) | fundCode |
get_fund_manager_list | List of all past managers | fundCode |
get_fund_manager_detail | Current manager's profile | fundCode |
Stocks/Indices
| Tool | Purpose | Key Parameters |
|---|---|---|
get_stock_trend | Intraday minute-by-minute trend | secid (e.g., 1.600519) |
get_stock_quote | Real-time stock quotes | secids (comma-separated) |
Market/Capital
| Tool | Purpose | Key Parameters |
|---|---|---|
get_market_overview | A-share market overview (Shanghai/Shenzhen) | None |
get_market_capital_flow | Market capital flow (large/small orders) | None |
get_sector_capital_flow | Sector capital ranking | timeType, code |
get_northbound_capital | Shanghai-Shenzhen-Hong Kong Stock Connect capital flow | None |
Portfolio Management
| Tool | Purpose | Key Parameters |
|---|---|---|
save_portfolio | Save/update portfolio holdings | fundCode, shares, costPrice |
remove_portfolio | Delete portfolio holding | fundCode |
get_portfolio | View portfolio list | None |
get_portfolio_profit | One-click query today's profit and total profit | None |
Scheduled Reminders
| Tool | Purpose | Key Parameters |
|---|---|---|
set_reminder | Set a scheduled reminder (triggers each trading day) | time(HH:MM), type, message |
get_reminders | View all reminders | None |
remove_reminder | Delete a reminder | id |
check_reminders | Check for due reminders | None |
Reminder types type:
profit_report— Portfolio profit report (triggersget_portfolio_profit, provides add/reduce position suggestions)market_report— Market summary report (triggers market overview + capital flow)custom— Custom reminder (usesmessageparameter)
Common Parameter Descriptions
Fund Code fundCode: 6 digits, e.g., 161725 (CSI Baijiu), 110011 (E Fund Mid & Small Cap)
Security ID secid: Format market.code
| Market Code | Meaning | Example |
|---|---|---|
1. | Shanghai Stock Exchange | 1.000001 (Shanghai Composite Index), 1.600519 (Kweichow Moutai) |
0. | Shenzhen Stock Exchange | 0.399001 (Shenzhen Component Index), 0.000858 (Wuliangye) |
116. | Hong Kong Stock Exchange | 116.01810 (Xiaomi Group) |
Time Range range: m=1 month, q=3 months, hy=6 months, y=1 year, 2y=2 years, 3y=3 years, 5y=5 years
Active Behavior (Important)
At the start of each conversation, you MUST call check_reminders
Regardless of what the user says, before replying, call check_reminders to check for due reminders. If any are due, follow these rules:
-
When
profit_reportis due:- Call
get_portfolio_profitto retrieve profit data - Call
get_market_overviewfor market context - Report today's portfolio profit summary in a friendly tone
- For each fund, provide action suggestions:
- Today's drop > 2%: "Consider adding to average down cost"
- Today's rise > 3%: "Significant rise, consider partial profit-taking"
- Total portfolio loss > 10%: "Large loss, suggest evaluating whether to continue holding"
- Total portfolio profit > 20%: "Substantial profit, suggest phased profit-taking to lock in gains"
- Finally, ask the user if they want to adjust their holdings
- Call
-
When
market_reportis due:- Call
get_market_overview+get_market_capital_flow+get_northbound_capital - Report market indices, capital flow, and northbound capital dynamics
- Call
-
When
customis due:- Display the custom reminder content to the user
If no reminders are due, process the user's request normally.
Typical Scenarios
User doesn't know the fund code
First use search_fund to search, then use the returned code to call other tools.
User asks "How's the market today?"
Call get_market_overview + get_market_capital_flow in sequence, reporting market levels, changes, trading volume, and capital flow.
User asks "How much did I make today?"
Directly call get_portfolio_profit, returning today's profit for each fund and a summary. If no holdings are recorded, guide the user to add them with save_portfolio.
User provides holding information
Parse fund code, shares, and cost price, then call save_portfolio for each. The name parameter can be omitted; the tool will automatically query and fill it in.
User wants to quickly import holdings (screenshot recognition)
If the current model supports image recognition (OCR), proactively prompt the user: they can directly upload a screenshot from a fund app (e.g., Tiantian Fund, Alipay, Ant Fortune), and the AI will automatically identify fund codes, names, shares, cost NAV, etc., then call save_portfolio for each holding to batch import, eliminating manual entry.
Processing flow:
- Identify each fund's info (code, shares, cost price) from the screenshot
- For incomplete fields (e.g., only name but no code), use
search_fundto complete the fund code - Call
save_portfoliofor each holding to save - After saving, display the imported holdings list in summary and ask the user to confirm if anything is missing or incorrect
User asks for a comprehensive analysis of a specific fund
Combine calls: get_fund_info + get_fund_estimate + get_fund_position + get_fund_accumulated_performance, analyzing from fundamentals, valuation, holdings, and historical returns across multiple dimensions.
User says "Set a daily afternoon reminder for profit"
Call set_reminder with parameters time="14:30", type="profit_report". After that, the first conversation each trading day after 14:30 will automatically trigger a profit report and suggestions.
Example reminder report
Good afternoon! It's 14:30 now, here is your portfolio profit report:
Portfolio Overview: 3 funds, total cost 15,000.00 yuan, current market value 14,520.00 yuan Today's Profit: -180.00 yuan | Total Profit: -480.00 yuan (-3.20%)
Fund Details:
- CSI Baijiu A (161725): Today -1.22%, holding loss -11.07%, suggest evaluating whether to continue holding
- E Fund Blue Chip (005827): Today +0.35%, holding profit +5.20%, keep holding
- GF Nasdaq (270042): Today +1.80%, holding profit +15.30%, good momentum
Need to adjust holdings?
Notes
- Valuation data updates only during A-share trading hours (9:30-15:00); outside trading hours, closing data is returned
get_fund_estimatereturns an estimated value, not the final NAV; remind the user of this- Portfolio data is persisted in
data/portfolio.json, retained across sessions - Profit calculation: Today's profit = shares × (estimated NAV - yesterday's NAV), total profit = shares × (estimated NAV - cost price)