Skip to main content
Glama
lolifamily

ashare-mcp

calculate_dcf_valuation

Perform discounted cash flow valuation for A-share stocks. Returns enterprise value; equity and per-share intrinsic value when net debt is provided.

Instructions

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 net_debt, which baostock does NOT publish — it must come from the balance sheet (interest-bearing debt minus cash & equivalents). Without it, only EV is returned and the caller can compute equity = ev - (their own net_debt).

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.

forecast_growth clamps fcf_cagr to growth_clamp_bounds ([-5%, 15%]); growth_clamped reports which bound (if any) was hit. Read it before using forecast_growth -- a raw CAGR outside the band was silently overridden.

intermediates.fcf_quality reports negative_years / sign_changes / min / max on the historical FCF series; fcf_cagr is endpoint-anchored and does not reflect intra-period volatility.

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]).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
discount_rateYes
terminal_growth_rateYes
capex_to_ocf_ratioYes
net_debtNo
forecast_yearsNo
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully discloses behavioral traits: OCF approximation precision, fallback from akshare to baostock, clamping of forecast_growth, graceful degradation of history, and reporting of fcf_quality. No annotation contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but well-structured with clear paragraphs and a bullet-like list for arguments. Front-loaded with core purpose. Some redundancy could be trimmed, but overall it earns its length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (multiple data sources, fallback, clamping, intermediate quality metrics), the description covers all critical aspects: return values (EV, equity), data provenance, and edge cases. No output schema, but the narrative sufficiently explains outputs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has no descriptions (0% coverage), so the description must compensate. It provides extensive meaning for each parameter: data sources, constraints (e.g., forecast_years must be 1-20), and usage conditions (e.g., capex_to_ocf_ratio ignored when akshare available).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it is a 'Simplified DCF valuation' and explains the derivation of OCF, FCF, and enterprise value. It distinguishes itself from sibling tools like calculate_ddm_valuation by focusing on DCF methodology.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides detailed usage context (e.g., fallback behavior, prerequisites for net_debt), but does not explicitly state when to use this tool versus alternatives like DDM or PEG ratio. Implicit guidance exists but lacks explicit comparisons.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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