ashare-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_historical_k_dataA | Fetch historical K-line (OHLCV + valuation) data for a Chinese A-share stock. Args: code: Stock code in baostock format, e.g. 'sh.600000', 'sz.000001'. start_date: Start date 'YYYY-MM-DD'. end_date: End date 'YYYY-MM-DD'. frequency: 'd' daily, 'w' weekly, 'm' monthly, '5'/'15'/'30'/'60' minutes. adjust_flag: '1' backward/后复权, '2' forward/前复权, '3' unadjusted/不复权 (default '3'). fields: Comma-separated field list. Defaults to all standard fields. |
| get_stock_basic_infoB | Fetch basic info: code, code_name, ipoDate, outDate, type, status. Args: code: Stock code, e.g. 'sh.600519'. |
| get_dividend_dataA | Fetch a year's dividends: annual cash total plus every payout's detail. A year with several distributions has one entry per payout in annual_cash_per_share_pretax is None when the year had distributions but no cash (pure stock dividend / capital reserve conversion); read each payout's dividStocksPs / dividReserveToStockPs for those. Args: code: Stock code. year: 4-digit year, e.g. '2023'. year_type: 'report' (announcement year) or 'operate' (ex-dividend year). Returns: {code, year, annual_cash_per_share_pretax, payout_count, payouts}. |
| get_adjust_factor_dataA | Fetch adjustment factor data for calculating adjusted prices. Factors exist only on ex-div / ex-rights dates; a window with none returns an empty list. Args: code: Stock code. start_date: 'YYYY-MM-DD'. end_date: 'YYYY-MM-DD'. |
| get_trade_datesA | Fetch trading calendar. Each row has calendar_date and is_trading_day ('1'/'0'). Args: start_date: Optional 'YYYY-MM-DD'. end_date: Optional 'YYYY-MM-DD'. |
| get_latest_trading_dateA | Most recent trading date with K-line data published. Returns 'YYYY-MM-DD'. Probes CSI 300 (sh.000300) directly and returns the date of its latest available daily bar. This is the safe anchor date for follow-up K-line queries — guaranteed to have data, regardless of wall-clock time. On a trading day before market close, today's bar is not yet published, so this returns the previous trading date. |
| get_all_stockA | Search stocks by name. Returns matching code, code_name, and tradeStatus. Args: query: Search keyword matched against code_name (substring, case-insensitive). An empty string matches every row and returns the full market (~5000+ stocks, ~1 MB). date: Date 'YYYY-MM-DD'. Defaults to the latest trading date. |
| get_stock_industryA | Fetch industry classification data. Args: code: Stock code, e.g. 'sh.600519'. date: Optional date 'YYYY-MM-DD'. Defaults to latest. |
| get_index_constituentsA | Fetch constituent stocks of a major A-share index. index:
Args: index: Which index's constituents to fetch. date: Optional date 'YYYY-MM-DD'. Defaults to latest. |
| get_benchmark_rate_dataA | Fetch PBoC benchmark deposit or loan rates within a date range. rate_type:
Args: rate_type: Which rate table to fetch. start_date: Optional 'YYYY-MM-DD'. end_date: Optional 'YYYY-MM-DD'. |
| get_required_reserve_ratio_dataB | Fetch required reserve ratio data. Args: start_date: Optional 'YYYY-MM-DD'. end_date: Optional 'YYYY-MM-DD'. year_type: '0' announcement date (default), '1' effective date. |
| get_money_supply_dataA | Fetch money supply data (M0, M1, M2) at monthly or yearly frequency. freq:
Args: freq: 'month' for the monthly series, 'year' for year-end balances. start_date: Optional. Format matches freq: 'YYYY-MM' (month) or 'YYYY' (year). end_date: Optional, same format as start_date. |
| get_financial_indicatorsA | Fetch a quarterly financial report; baostock splits quarterly fundamentals across six statements, each with a distinct field set. All values are cumulative-from-year-start: quarter=1 is 3-month, 2 is H1 (6-month), 3 is 9-month, 4 is FY (12-month). report:
Args: code: Stock code, e.g. 'sh.600519'. report: Which statement to fetch (see above). year: 4-digit year, e.g. '2024'. quarter: 1, 2, 3, or 4. |
| get_performance_reportA | Fetch performance express (业绩快报) or forecast (业绩预告) reports. kind:
Args: code: Stock code. kind: 'express' for filed express reports, 'forecast' for guidance. start_date: 'YYYY-MM-DD'. end_date: 'YYYY-MM-DD'. |
| get_technical_indicatorsA | Calculate technical indicators for a stock. Trend/momentum indicators use forward-adjusted prices. Volume indicators (OBV, MFI) transparently fetch a second pass with raw bars because baostock does not split-adjust volume — mixing forward-adjusted price with raw volume would distort money-flow on split / bonus-issue days. Volume indicators thus cost one extra network round-trip when requested. Returns one row per trading day in [start_date, end_date]. Warmup is auto-prefetched, so values inside the range are not null from warmup. Args: code: Stock code. start_date: 'YYYY-MM-DD'. end_date: 'YYYY-MM-DD'. indicators: List from ['MACD','RSI','KDJ','BOLL','WR','STOCH','CCI','ATR','ADX','OBV','MFI']. Defaults to all. |
| get_moving_averagesA | Calculate SMA and EMA for multiple periods over the requested date range. Returns one row per trading day in [start_date, end_date]. Warmup is auto-prefetched, so values inside the range are not null from warmup. A period exceeding the stock's available history yields present-but-all-null SMA_/EMA_ columns, so a requested period never silently vanishes. Args: code: Stock code. start_date: 'YYYY-MM-DD'. end_date: 'YYYY-MM-DD'. periods: Period list (each must be >= 1), e.g. [5,10,20,50,120,250]. Defaults to common set. |
| calculate_risk_metricsA | Calculate risk metrics: beta, Sharpe, max drawdown, volatility, correlation. Args: code: Stock code. benchmark_code: Benchmark index, default 'sh.000300' (CSI 300). lookback_days: Calendar days to look back. 365 ≈ 1 year, 730 ≈ 2 years. Must yield >= 30 trading-day bars (~45+ calendar days, more if the span crosses a long holiday) or the call is rejected. ~245 calendar days ≈ 1 trading year (CN A-share). risk_free_rate: Annualized risk-free rate for Sharpe ratio. Default ~3% (approximate CN 10Y bond yield); override for non-CN markets. |
| get_financial_statementA | Fetch a full financial statement (all periods, all columns) from EastMoney via akshare.
Returns raw EastMoney field names (English uppercase keys), rows ordered most-recent-first (newest period at index 0). Columns entirely empty across the returned periods are dropped. IMPORTANT — for "income" and "cash_flow", quarterly values are cumulative YTD (year-to-date), not single-quarter:
Args: code: Stock code in baostock format, e.g. 'sh.600519'. statement: Which statement — "balance", "income", or "cash_flow". periods: How many most-recent report periods to return (default 8 ≈ 2 years of quarterly filings). Raise only when you need older periods — the full history is large. |
| get_net_debtA | Compute net debt from the latest balance sheet (conservative upper bound). net_debt = SHORT_LOAN + LONG_LOAN + BOND_PAYABLE + NONCURRENT_LIAB_1YEAR - MONETARYFUNDS NONCURRENT_LIAB_1YEAR is a CN-GAAP aggregate bucket containing both long-term-debt current portion (interest-bearing) and lease-liability / long-payable current portions (not interest-bearing); the breakdown is not exposed by EastMoney. For lease-heavy or zero-leverage firms the returned net_debt is overstated by the non-interest portion of this bucket. Data source: EastMoney via akshare. Returns net_debt value, component breakdown, and the report date of the balance sheet used. Args: code: Stock code in baostock format, e.g. 'sh.600519'. |
| get_valuation_metricsA | Fetch valuation metrics (PE/PB/PS/PCF) history and current snapshot. Each metric in Each non-close metric also reports positive_mean/positive_median/
positive_min/positive_max plus Args: code: Stock code. start_date: Optional, defaults to 1 year ago. end_date: Optional, defaults to today. |
| calculate_peg_ratioA | Calculate PEG = current PE_TTM / G, with G the latest published YoY net profit growth. PE is the latest available quote; G is the most recently disclosed YoY
growth, returned as PEG is undefined and returns peg=None when:
Args: code: Stock code. |
| calculate_ddm_valuationA | DDM (Dividend Discount Model) valuation. Uses dividCashPsBeforeTax from baostock. Auto-sums semicolon-separated multi-payouts. Current price from latest K-line close. Excludes the current calendar year, whose dividend bucket is usually incomplete mid-year. Buckets are by announcement year, so a prior fiscal year's final payout and the next year's interim can land in the same bucket, distorting dividend_cagr.
Args: code: Stock code. discount_rate: Required rate of return, e.g. 0.10. terminal_growth_rate: Perpetual growth rate, e.g. 0.025. years_back: Years of dividend history to use. forecast_years: Projection period (must be in [1, 20]). |
| calculate_dcf_valuationA | Simplified DCF valuation. OCF derived as MBRevenue * CFOToOR (~2% precision). FCF = OCF * (1 - capex_to_ocf_ratio). Caller must supply capex_to_ocf_ratio because baostock provides no Capex data. Enterprise value (EV) is always returned. To derive equity value and
per-share intrinsic value, caller must provide When akshare is installed and reachable, real operating cash flow (NETCASH_OPERATE) and real capex (CONSTRUCT_LONG_ASSET) are used automatically (capex_to_ocf_ratio is then ignored), and net_debt is computed from the balance sheet if not provided. If akshare is absent or fails at runtime (rate-limit, anti-scrape), the calculation falls back to baostock estimation using capex_to_ocf_ratio. data_provenance indicates which path. Uses a fixed 5-year FCF history, degrading gracefully to as few as 2 years when reports are missing.
Args: code: Stock code. discount_rate: WACC / discount rate, e.g. 0.10. terminal_growth_rate: Perpetual growth rate, e.g. 0.025. capex_to_ocf_ratio: Capex as a fraction of OCF. Always required, but used only on the baostock fallback path; ignored when akshare's real capex is available. net_debt: Interest-bearing debt minus cash & equivalents (CNY). Negative = net cash position. Required for per-share valuation. forecast_years: Projection period (must be in [1, 20]). |
| compare_industry_valuationA | Compare a stock's valuation (PE/PB/PS) against its industry peers. Behavior contract:
Args: code: Target stock code. date: Comparison date 'YYYY-MM-DD'. Defaults to latest. |
| get_stock_snapshotA | One-call snapshot: latest price, valuation, industry, total shares, net profit. Combines data from K-line, stock_industry, and profit_data. Designed for individual stocks. An index (sh.000300, etc.) has K-line + valuation but no industry / basic / profit rows; those fields come back null instead of aborting the call, so price + PE/PB/PS are still returned. Profit fields ( baostock fills MBRevenue only on H1 / FY reports, so Args: code: Stock code. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/lolifamily/ashare-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server