Skip to main content
Glama

crashtestyourstrategy

Portfolio stress (multi-asset, instant)

portfolio_stress_test
Read-onlyIdempotent

USE WHEN you want to stress a portfolio of SPY, TLT, GOLD and BTC across cross-asset regimes. Provide holdings as [{asset, weight}] (weights normalised; GLD accepted for GOLD, BTC-USD for BTC). Returns per regime (baseline / risk_off_crisis / rate_shock): return, worst-episode drawdown, per-leg decomposition and a cross_asset_finding (diversification_intact / hedge_holds / hedge_breaks / shared_drawdown / concentrated_loss), plus sustained drawdowns over the simulated paths. The joint correlation structure, including the bond hedge that can break under rate shocks, comes from a pre-computed substrate, so the call is instant. Optional costs ({rebalance: none|daily|monthly|quarterly|band, annual_costs: {asset: fraction}, transaction_cost_bps}) adds a cost_impact block paired on identical paths. Other tickers: build_portfolio (full tier, needs an access token) in assess mode (portfolios={name:{ticker:weight}}). Descriptive, not advisory.

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": {
      "holdings": "<holdings>"
    },
    "name": "portfolio_stress_test"
  }
}

Input Schema

NameRequiredDescriptionDefault
costsNoOptional cost model: {'rebalance': 'monthly', 'transaction_cost_bps': float, 'annual_costs': {ASSET: annual fraction}}. Omit for the frictionless default.
holdingsYesPortfolio legs: list of {asset, weight} objects, e.g. [{'asset': 'SPY', 'weight': 0.6}, {'asset': 'TLT', 'weight': 0.4}]. Assets: SPY, TLT, GOLD, BTC (aliases GLD, BTC-USD). Weights are non-negative and normalised to sum to 1; at most 50 legs, no duplicates.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / holdings / description
      Previous value: -"Portfolio legs: list of {asset, weight} objects, e.g. [{'asset': 'SPY', 'weight': 0.6}, {'asset': 'TLT', 'weight': 0.4}]. Weights are normalised to sum to 1; assets must be in the substrate universe."New value: +"Portfolio legs: list of {asset, weight} objects, e.g. [{'asset': 'SPY', 'weight': 0.6}, {'asset': 'TLT', 'weight': 0.4}]. Assets: SPY, TLT, GOLD, BTC (aliases GLD, BTC-USD). Weights are non-negative and normalised to sum to 1; at most 50 legs, no duplicates."
  2. Changed2 schema fields changed
    • addedInput schema / properties / costs / description
      Added value: +"Optional cost model: {'rebalance': 'monthly', 'transaction_cost_bps': float, 'annual_costs': {ASSET: annual fraction}}. Omit for the frictionless default."
    • addedInput schema / properties / holdings / description
      Added value: +"Portfolio legs: list of {asset, weight} objects, e.g. [{'asset': 'SPY', 'weight': 0.6}, {'asset': 'TLT', 'weight': 0.4}]. Weights are normalised to sum to 1; assets must be in the substrate universe."
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so safety is covered. The description adds genuinely non-obvious behavior: correlation structure comes from a pre-computed substrate (hence 'instant'), the bond hedge can break under rate shocks, and cost impact is computed on identical paths for a fair comparison. It does not discuss determinism across calls or any limits on the substrate's coverage.

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?

It is front-loaded with the trigger condition and keeps to a single dense paragraph with no filler sentences. The per-regime return enumeration is somewhat redundant given an output schema exists, which is the main thing that could be trimmed.

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?

For a two-parameter analytical tool, the description covers the trigger, the input contract, the output shape, the optional cost model, the supported asset universe, and the escape hatch for other tickers. Nothing an agent needs in order to call it correctly is missing.

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 100%, so the baseline is 3, but the description adds real meaning: it enumerates the full rebalance enum (none|daily|monthly|quarterly|band) where the schema only shows 'monthly' as an example, and it restates alias handling (GLD for GOLD, BTC-USD for BTC) and weight normalisation. The shape of the costs object (annual_costs as fractions, transaction_cost_bps) is also clarified beyond the schema.

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 opens with a specific verb and resource ('stress a portfolio of SPY, TLT, GOLD and BTC across cross-asset regimes') and immediately scopes which assets are supported, which is the key differentiator from the general-purpose siblings. An agent can distinguish this from build_portfolio, run_stress_test, or tier2_stress_test without opening a schema.

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?

It gives an explicit trigger ('USE WHEN you want to stress a portfolio of...') plus the alternative path for out-of-scope tickers ('build_portfolio (full tier, needs an access token) in assess mode'), including the prerequisite that alternative requires. It also states the output is 'Descriptive, not advisory', which sets expectations about how results should be used.

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.