analyze_portfolio_risk
Calculate risk and return metrics for a multi-asset portfolio in one base currency, including volatility, drawdown, beta, and Sharpe ratio for holdings given by symbol or ISIN.
Instructions
Risk and return of a whole portfolio, measured in one base currency.
Positions can be stocks or ETFs, given by Yahoo symbol or ISIN, sized
by quantity (shares) or current value (in base currency); with
neither, positions are equally weighted. Prices are converted to the
base currency with daily FX (pence-quoted London listings handled),
put on a common calendar, and analysed. Use analyze_portfolio
(justETF) for cost and country/sector/stock look-through of ETFs.
Example positions: [{"isin": "IE00B4L5Y983", "value": 30000},
{"symbol": "ASML.AS", "quantity": 10}, {"symbol": "AAPL", "quantity": 25}]
Args:
positions: Up to 30 holdings: {symbol | isin, quantity | value}.
base_currency: ISO code of the investor's currency. Default EUR.
benchmark: Optional Yahoo symbol, e.g. "IWDA.AS" or "^GSPC".
start_date: YYYY-MM-DD. Defaults to 3 years before end_date.
end_date: YYYY-MM-DD (exclusive). Defaults to the latest data.
interval: Return frequency. Default "1wk": daily returns across
regions (US vs Europe) understate correlation and beta because
the markets close hours apart.
method: "current_holdings" (today's units held throughout) or
"constant_weights" (rebalanced to today's weights each period).
risk_free_rate_pct: Annual risk-free rate in %, e.g. 2.0.
Returns:
Total value and weights; portfolio return, volatility,
Sharpe/Sortino/Calmar, max drawdown (dates); vs `benchmark` beta,
alpha, tracking error, information ratio; per position return,
volatility, beta and share of portfolio risk; correlation matrix;
diversification ratio; how ISINs were resolved; FX rates used;
warnings (short histories, stale quotes, bad Yahoo prices
removed). 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": {
"positions": "<positions>"
},
"name": "analyze_portfolio_risk"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | current_holdings | |
| end_date | No | ||
| interval | No | 1wk | |
| benchmark | No | ||
| positions | Yes | ||
| start_date | No | ||
| base_currency | No | EUR | |
| risk_free_rate_pct | No |