Skip to main content
Glama

Run strategies through a stress scenario

run_stress_scenario
Read-onlyIdempotent

Run trading strategies through a macro stress scenario beside an unshocked market, then compare results to detect how each strategy responds. Deterministic and reproducible.

Instructions

Run strategies through a macro stress scenario, always beside the same market unshocked, and compare each strategy across the two. scenario is a shipped document by name (list_scenarios gives each one's first_event_day, and the run must be longer than that), a constructor by name (vix_shock, rate_ramp, timed with peak_day), or a document from build_scenario. A scenario whose events all fall after the run is refused. Pass fork_day to run both markets together first and start the scenario on that day, as a fork of one shared history. Use the result to detect a response, not to forecast its size. days 1 to 60 here, up to 252 through start_job. Deterministic.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoTrading days to run: 1 to 60 in a direct call, up to 252 (the certified horizon) through start_job.
seedNoSimulation seed, an integer from 0 to 2**64 - 1. The same seed and arguments give the same result.
fork_dayNoRun both markets together for this many days, then split them and start the scenario on the first day after the split: day `fork_day` of the run. The scenario's events keep their spacing, and every strategy trades the shared days identically in both arms. 0 to days - 1. Only for a scenario made of interventions (a shipped document, or build_scenario with `shocks`); a macro path or a constructor pins the macro from day 0, so it has no fork point.
peak_dayNoConstructors only. vix_shock: the day the VIX jumps to its peak (default 10). rate_ramp: the day the policy rate and corporate yield reach their end level (default 30). A vix_shock peak must fall inside the run.
scenarioYesA shipped document by name (list_scenarios lists them with the day each one's first event falls on, and the run must be longer than that), a constructor by name (vix_shock, rate_ramp, timed with peak_day), or a scenario document from build_scenario.
universeNoA roster document, usually the `universe` field of a build_universe result. Either {"size": n, "seed": s, "sectors": [...]} or {"instruments": [...]}. When given it replaces universe_size, universe_seed and universe_sectors.
strategiesNoOptional strategies to run beside the baselines, in the evaluate_strategies form. The baseline names are taken.
universe_seedNoSeed that generates the roster, separate from the simulation seed. Ignored when `universe` is given.
universe_sizeNoNames in a generated roster, 2 to 120. Ignored when `universe` is given.
universe_sectorsNoLowercase sector ids to concentrate a generated roster on, for example ["technology", "energy"]. The ids: technology, financial_services, healthcare, energy, consumer_discretionary, consumer_staples, industrials, materials, real_estate, utilities, telecommunications, transportation. A concentrated roster is a named envelope gap, and the result says so.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.1
    • addedInput schema / properties / fork_day
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Run both markets together for this many days, then split them and start the scenario on the first day after the split: day `fork_day` of the run. The scenario's events keep their spacing, and every strategy trades the shared days identically in both arms. 0 to days - 1. Only for a scenario made of interventions (a shipped document, or build_scenario with `shocks`); a macro path or a constructor pins the macro from day 0, so it has no fork point.",
      +  "title": "Fork Day"
      +}
  2. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds real behavioral context beyond them: determinism, the hard refusal rule for out-of-window scenarios, the fork mechanic where both arms trade shared days identically, and the note that a concentrated roster is a named envelope gap surfaced in the result.

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?

Information-dense and front-loaded with purpose and the two-arm comparison, but it restates material already in the schema (the scenario-source enumeration and the 1-to-60/252 day limits appear in both places), which costs a little efficiency without hurting comprehension.

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?

With 10 parameters, an output schema, and full schema descriptions, the description supplies exactly the missing operational layer: valid scenario sources, refusal conditions, fork applicability, horizon routing to start_job, and determinism. Nothing an agent needs to call this correctly is absent.

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; the description still adds meaning, clarifying that fork_day only applies to intervention-based scenarios (a macro path or constructor pins the macro from day 0), that peak_day is constructor-only, and that days is capped at 60 here versus 252 via start_job.

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?

States a specific verb and resource ('Run strategies through a macro stress scenario') and immediately pins the distinctive design: every run sits beside an unshocked twin market and the two are compared. This separates it from sibling evaluation tools like evaluate_strategies and rank_strategies, which lack the shock/control contrast.

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 enumerates the three accepted scenario sources (shipped document via list_scenarios, constructor vix_shock/rate_ramp, or build_scenario output), states the refusal condition when all events fall after the run, explains when to pass fork_day, and routes the 252-day horizon to start_job. It even sets the interpretive frame: 'detect a response, not to forecast its size.'

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