Skip to main content
Glama
Portfolio Analytics MCP

Portfolio Analytics MCP

by RugSec

get_performance_stats

Read-only

Calculate return and risk statistics per ticker—including Sharpe, drawdown, and beta/alpha versus a chosen benchmark—to compare investment performance.

Instructions

Return and risk statistics per ticker, optionally vs a benchmark.

Total and annualised return (annualised only for windows >= 1 year),
annualised volatility, Sharpe, Sortino, Calmar, max drawdown with peak /
trough / recovery dates, best and worst period. With `benchmark`: beta,
alpha, correlation, tracking error and information ratio. Uses adjusted
closes (dividends reinvested). Each ticker uses its own available window,
so check `from`/`to` before comparing; for a portfolio use
analyze_portfolio_risk.

Args:
    tickers: Yahoo symbols.
    start_date: YYYY-MM-DD. Defaults to 2020-01-01.
    end_date: YYYY-MM-DD (exclusive). Defaults to the latest value.
    interval: Return frequency: "1d", "1wk" or "1mo".
    base_currency: Optional ISO code to measure everything in (e.g. "EUR"
        for a euro investor holding USD assets); default local currency.
    risk_free_rate_pct: Annual risk-free rate in %, for Sharpe/Sortino.
    benchmark: Optional Yahoo symbol to compare against, e.g. "IWDA.AS".

Returns:
    `stats` per ticker (with `vs_benchmark` when given), the currency used
    and any `warnings`; or an error dict.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "tickers": "<tickers>"
    },
    "name": "get_performance_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
tickersYes
end_dateNo
intervalNo1d
benchmarkNo
start_dateNo2020-01-01
base_currencyNo
risk_free_rate_pctNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, so the bar is lower. The description still adds real substance: adjusted closes with dividends reinvested, annualisation only for windows >= 1 year, per-ticker window differences, and the warnings/error return shape. It does not mention Yahoo rate limits or missing-data fallbacks, keeping it short of a 5.

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

Conciseness5/5

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

Front-loaded summary of outputs, then a compact Args block with one line per parameter. Dense but every sentence (dividends reinvested, window caveat, portfolio hand-off) carries information an agent would otherwise get wrong.

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 7 parameters, the return payload, error and warning cases, and the key comparison pitfall. There is no output schema, so the Returns section doing that work is appropriate; only minor omissions (symbol validation, failure modes) remain.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must carry all meaning and it mostly does: date formats, end_date exclusivity, interval values, benchmark example symbol, base_currency rationale, and risk-free rate usage. Minor gap: no guidance on tickers format beyond 'Yahoo symbols' and no validation behaviour for invalid symbols.

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?

States a specific verb+resource ('return and risk statistics per ticker') and enumerates the exact metrics computed, which distinguishes it cleanly from siblings like get_correlation, get_etf_performance and analyze_portfolio_risk.

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 routes portfolio-level work to analyze_portfolio_risk and warns that per-ticker windows differ so from/to must be checked before comparing. It lacks exclusions against get_etf_performance or get_price_history, but the key alternative is named.

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