Skip to main content
Glama

Get portfolio analytics

get_portfolio_analytics
Read-only

Analyze 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

TableJSON Schema
NameRequiredDescriptionDefault
daysNoCalendar-day lookback for daily USD return analytics. Default 370.
portfolioIdYesThe portfolio id, as returned by list_portfolios.
privacyModeNo"full" (default) includes absolute USD amounts; "weights_only" returns only relative figures.
candidateTickerNoOptional exact Bullrun ticker to test as a candidate diversifier, e.g. AAPL, NESN.SW, BMW.DE.
candidateWeightPctNoOptional hypothetical candidate allocation for pro-forma volatility. Default 5 (%).
Behavior5/5

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

Discloses important behaviors beyond annotations: risk math drops unpriced holdings, coverage banner, privacyMode effects, OAuth requirements. Consistent with readOnlyHint annotation.

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?

Well-structured with use cases first, then technical details. Slightly verbose but all sentences add value. Could be tightened slightly.

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?

Despite no output schema, description thoroughly explains what analytics are returned (correlation matrices, contributions, exposures, scenario tests) and warns about coverage limitations.

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 already documents all parameters (100% coverage). Description adds context for candidateTicker and candidateWeightPct, explaining their purpose in candidate diversification analysis.

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 fetches portfolio-level relationship analytics for risk, diversification, concentration, and adding stocks. It distinguishes from sibling get_portfolio_context.

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

Usage Guidelines5/5

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

Explicitly states when to use (portfolio risk/diversification/concentration queries) and when not to (use get_portfolio_context for plain holdings snapshot).

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/ferinator/bullrun-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server