Skip to main content
Glama
lolifamily

ashare-mcp

calculate_risk_metrics

Calculate stock risk metrics including beta, Sharpe ratio, max drawdown, volatility, and correlation against a benchmark.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
benchmark_codeNosh.000300
lookback_daysNo
risk_free_rateNo
Behavior3/5

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

No annotations provided. Description reveals the constraint that lookback_days must yield >=30 trading-day bars or call is rejected, but does not disclose other behaviors like read-only nature or side effects.

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?

Front-loaded with purpose, then clear parameter docs. Slightly verbose but every sentence adds value. Could be more concise without losing information.

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

Completeness4/5

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

Covers all parameters with defaults and usage notes, lists returned metrics. No output schema, but description adequately explains what to expect. Missing prerequisites or data source info, but sufficient for a focused financial metrics tool.

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?

With 0% schema coverage, description fully compensates by explaining each parameter: code (stock code), benchmark_code (default and meaning), lookback_days (conversion to trading days, minimum constraint), risk_free_rate (default and context).

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?

Description clearly states it calculates risk metrics (beta, Sharpe, max drawdown, volatility, correlation) and distinguishes from siblings like calculate_dcf_valuation, which are valuation-focused.

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

Usage Guidelines4/5

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

Explicitly states what the tool computes and provides defaults for benchmark and risk-free rate, implying usage context. However, it does not explicitly say when not to use it or compare to alternatives.

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