Skip to main content
Glama

Portfolio stress test

stress_test
Read-onlyIdempotent

Stress-test the signed-in user's portfolio (PRIMARY by default): the standard scenarios plus the ones asked — a market move (market_pct, e.g. -10), a sector move (sector + sector_pct, e.g. Technology -20), one holding's move (ticker + ticker_pct), or a real past session replayed on today's weights (replay_date, up to 5 years back). Estimates from each line's beta and real past returns, in value and percent — never a forecast. Free: no analysis credit. Requires the user to be connected. Example: "what happens to my portfolio if tech drops 20%?" → sector Technology, sector_pct -20.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "stress_test"
  }
}

Input Schema

NameRequiredDescriptionDefault
sectorNoSector to shock, e.g. Technology, Energy, Healthcare.
tickerNoOne holding to shock, e.g. NVDA.
portfolioNoOptional: a portfolio name, or 'all'. Defaults to the primary portfolio.
market_pctNoS&P 500 move to apply, in percent (e.g. -10).
sector_pctNoMove applied to that sector's holdings, in percent.
ticker_pctNoMove applied to that holding, in percent.
replay_dateNoA past session to replay, YYYY-MM-DD (e.g. 2025-04-04).

Output Schema

NameRequiredDescriptionDefault
okYesfalse on an error; then `error` says what happened and what to do.
cardNoThe in-chat InvestIQ card, in English and French.
dataNoThe tool's own result fields.
toolYes
as_ofYesISO time the data was computed (a stored analysis: when it was computed).
errorNo
linksNoInvestIQ pages for this result.
degradedNotrue when part of the data was missing.
viz_specNoThe recommended chart's series (data only).
disclaimerYes
data_qualityNoWhat was requested, what was used, and why anything was left out.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the supplied annotations: it discloses the estimation methodology (per-line beta and real past returns), that results are hypothetical rather than forecasts, that the call is free with no analysis credit cost, and that the user must be connected. With an output schema present, return formatting need not be restated.

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?

Front-loads the core action and the portfolio default, then packs scenario modes, cost, and prerequisite into three tight sentences with a worked example. Dense but every clause carries information; the em-dash enumeration is slightly hard to parse at speed.

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?

Annotations cover the safety profile, the output schema covers return values, and the schema documents all seven parameters; the description fills the remaining gaps an agent needs for correct invocation: pairing rules, replay window, default portfolio, cost, and connectivity prerequisite.

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 coverage is already 100%, so the baseline is 3; the description still adds meaning beyond the schema by specifying which parameters pair together (sector + sector_pct, ticker + ticker_pct) and by adding the 5-year lookback limit on replay_date, which is not encoded in the schema. It does not state whether multiple scenario types may be combined in one call.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('stress-test the signed-in user's portfolio') and enumerates the exact scenario taxonomy: market move, sector move, single-holding move, and historical replay. It implicitly separates itself from actual-risk siblings like portfolio_risk by framing output as hypothetical estimation ('never a forecast'), but never names an alternative explicitly.

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?

Gives a concrete user-question-to-arguments mapping ('what happens to my portfolio if tech drops 20%?' → sector Technology, sector_pct -20) and states the default portfolio is PRIMARY. It lacks explicit when-not guidance, e.g. pointing to portfolio_risk for actual measured risk rather than hypothetical shocks.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources