Get portfolio analytics
get_portfolio_analyticsAnalyze portfolio risk, diversification, and concentration. Compute correlations, covariance, contribution-to-risk, and run scenario tests to evaluate portfolio health and test candidate additions.
Instructions
Use when the user asks about THEIR portfolio's risk, diversification, or concentration, or whether to add a stock — e.g. "is my portfolio diversified", "how risky is my portfolio", "am I too concentrated", "what's my exposure to X", "should I add NVDA", "would AAPL improve my diversification". Fetches portfolio-level relationship analytics for one signed-in user's portfolio: correlation and annualized covariance matrices across holdings, contribution-to-risk, concentration by weight and risk, currency/sector/country exposures, value/growth/momentum/quality/size proxy factor scores, scenario/stress tests (rates +100bp, oil -20%, USD +10%), and optional candidateTicker fit analysis showing correlation to the current portfolio plus pro-forma volatility (set candidateTicker when the user asks whether to add a specific stock). Pass a portfolioId from list_portfolios. The risk math only covers holdings with enough price history, dropping unpriced/unmatched ones (ETFs, funds, untracked tickers) and renormalizing all percentages over what remains; the response leads with a coverage banner (first text block) stating how many holdings were excluded, so never read these figures as the whole portfolio. For a plain holdings/value snapshot and the full matched/unmatched breakdown use get_portfolio_context instead. Requires OAuth (read:portfolios) and returns the caller's own data only. privacyMode defaults to "full"; "weights_only" hides absolute USD amounts while keeping weights, percentages, correlations and scores.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Calendar-day lookback for daily USD return analytics. Default 370. | |
| portfolioId | Yes | The portfolio id, as returned by list_portfolios. | |
| privacyMode | No | "full" (default) includes absolute USD amounts; "weights_only" returns only relative figures. | |
| candidateTicker | No | Optional exact Bullrun ticker to test as a candidate diversifier, e.g. AAPL, NESN.SW, BMW.DE. | |
| candidateWeightPct | No | Optional hypothetical candidate allocation for pro-forma volatility. Default 5 (%). |