Portfolio Context
portfolio_contextAn LLM-ready snapshot of ONE of the user's OWN portfolios (owner-scoped) — analyze it directly.
NO window → default: meta · summary · a lifetime(all-time) + recent(~12mo) block, EACH with
performance (return/cagr/sharpe/sortino/calmar/drawdown/vol/win_rate) + attribution · positions
· closed_positions (realized_pnl) · composition (point-in-time holdings) · allocation ·
concentration (HHI) · inferred_behavior · flags. portfolio_id from list_portfolios; 404 if
not the user's.
TIME WINDOW — `from_`/`to` (ISO) or `window` (`7d|30d|90d|180d|1y|mtd|qtd|ytd`): REPLACES lifetime+
recent with ONE `window` block (that span's `performance` + `attribution` + `nav_trend`) and scopes
`composition` to match. So ANY period's return + drivers is answerable. `snapshots` = composition
granularity only (`year|quarter|month|week|day|off`).
🔴 MANDATORY for period questions: the default / `lifetime` / `recent` blocks DO NOT contain the
performance or attribution of an arbitrary period (e.g. Q1-2025, "H1 2024"). To answer ANY specific
period — or to COMPARE periods (Q1/25 vs Q1/26, 2023 vs 2025) — you MUST call this tool AGAIN with
`from_`/`to` (or `window`) for EACH period, then compare the returned `window` blocks. NEVER derive a
period's return/sharpe/drawdown/attribution from the default view — those numbers aren't in it; making
them up is a hard error. If you haven't fetched a period's window, say you need to fetch it, don't guess.
HOW TO ANALYZE (research-analyst framing — see avaadvisor://policy):
• Lead with the sharpest thing: a non-empty `flag`, or the biggest concentration / drawdown / tilt.
• "What drove the return / drawdown / strengths & weaknesses" (for the default OR a window) → read
`attribution.contributors[]` (per-holding `pnl_contribution` + `pct_of_nav_change` + `held` window;
reconciles to `nav_change` to the cent, INCLUDES since-sold names). Don't estimate it yourself.
• "What did I hold on date X / how did the book evolve" → `composition` (set `snapshots` + a window).
• ⚠️ TRUST THE EDGE NOTES, never fabricate: a window before the portfolio's `inception_date` returns
`window.empty=true` + a note (or clamped) — say "the portfolio didn't exist then". If
`composition.coarsened` is true, the step was widened to stay bounded — for finer, narrow the window.
• NEWS-AWARE: fuse `stock_impact` / `news_feed`/`search_news` on the holdings' `theme` paths for the
WHY (⚠️ news only covers 2026+; portfolio history goes back to inception, further than news).
• Facts, not advice. Observe; do NOT tell them to buy/sell/rebalance/time — hand the judgment back.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": {
"portfolio_id": "<portfolio_id>"
},
"name": "portfolio_context"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Window end YYYY-MM-DD. | |
| from_ | No | Window start YYYY-MM-DD — re-scopes performance/attribution/composition together. | |
| window | No | Re-scope perf+attribution+composition to a period: `7d`/…/`ytd`. Omit → lifetime + recent(12mo). | |
| snapshots | No | Point-in-time composition cadence: `year|quarter|month|week|day|off` (default quarter); auto-coarsens over long spans. | |
| portfolio_id | Yes | The portfolio's id (call list_portfolios first if the user says 'my portfolio' without a number). |