Skip to main content
Glama

Stress-test a strategy's returns

stress_test
Read-onlyIdempotent

Bootstrap strategy returns to gauge drawdown breach frequency and Sharpe negativity. Simulate crash, volatility, repeat, and stuck-position scenarios, with a fragility share.

Instructions

Stress a strategy's returns: bootstrap histories (how often the drawdown limit breaks or Sharpe turns negative) and named crash, volatility, repeat and stuck-position scenarios, with a fragility share. Frequencies over resampled histories are not forecasts of the future.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedNoDefault 42; reproduces exactly.
blockNoMean block length; default cube root of n.
crashNoCrash size, negative; default min(-0.2, 3x worst period).
pathsNoDefault 1000.
returnsNoStrategy returns as fractions, oldest first.
returns_fileNoCSV or JSON of returns on this machine; local server only.
drawdown_limitNoFraction; default 0.2.
outage_periodsNoStuck periods after the worst; default 5.
returns_columnNoColumn name or 1-based position.
periods_per_yearNo252 daily (default), 365 crypto, 52 weekly, 12 monthly.
volatility_multiplierNoDefault 2.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitsNo
sourceNo
baselineNo
fragilityNo
resampledNo
scenariosNo
plain_readingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv0.13.0
    • removedInput schema / properties / outage_periods / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / outage_periods / minimum
      Removed value: --9007199254740991
    • removedInput schema / properties / paths / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / paths / minimum
      Removed value: --9007199254740991
    • changedInput schema / properties / returns_column / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "maximum": 9007199254740991,
      -    "minimum": -9007199254740991,
      -    "type": "integer"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "integer"
      +  }
      +]
    • removedInput schema / properties / seed / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / seed / minimum
      Removed value: --9007199254740991
    • removedOutput schema / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / baseline / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / fragility / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / resampled / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / source / additionalProperties
      Removed value: -{}
  2. Addedv0.12.0

TDQS

A3.7/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 behavior, so the safety profile is covered. The description adds genuine epistemic context beyond that: it reports frequencies (drawdown-limit breaches, negative Sharpe, a fragility share) and explicitly warns that these resampled frequencies are not forecasts of the future. Return-value detail is partly redundant with the output schema.

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?

Two tightly packed sentences, front-loaded with the core action and modes. The closing caveat about non-forecasting frequencies is short and earns its place, though the mode list is compressed densely enough to read slightly telegraphically.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 11 optional parameters, full schema coverage, an output schema, and complete annotations, the description only needs to convey purpose, modes, and interpretation caveats, which it does. It could be stronger by stating the required input form (returns or returns_file) or routing among sibling validators, but nothing essential is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every parameter's meaning and default is already documented in the schema. The description references the drawdown limit and negative-Sharpe condition conceptually but adds no syntax, units, or default information beyond what the schema provides; baseline 3 applies.

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?

The description gives a specific verb (stress) plus resource (a strategy's returns) and enumerates the two modes it runs: bootstrap resampling and named crash/volatility/repeat/stuck-position scenarios. It does not, however, differentiate itself from nearby siblings such as placebo_test or backtest_strategy, which also consume a strategy's return series.

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

Usage Guidelines3/5

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

Usage is only implied: an agent can infer this is for robustness/fragility analysis of a return series. There is no explicit when-to-use or when-not-to-use statement, and no sibling tool is named as the alternative for a related question.

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