Skip to main content
Glama

whatif

Replay a backtest with modified parameters to compare hypothetical strategy outcomes, such as different EMA periods or stop-loss levels.

Instructions

Counterfactual replay: same as replay_window plus a strategy-name filter and required param_overrides. Use for 'what if EMA period was 50 instead of 21' / 'show me the PnL if I had used a wider stop'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
strategyYes
to_ts_nsNo
from_ts_nsNo
param_overridesYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv0.6.9
  2. Removedv0.6.8
  3. First observedv0.6.3

TDQS

A4.4/5.0
Behavior3/5

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

With no annotations, the description must carry the burden of disclosing side effects. 'Counterfactual replay' and 'same as replay_window' imply a simulation, but it never explicitly states whether this is read-only, whether it can affect trading state, or what safety constraints apply. The examples hint at output (PnL), but not enough for full transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the core concept, then practical examples. No filler or redundant phrasing, and the structure makes the tool's purpose immediately accessible.

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?

Given the tool's complexity (nested object param_overrides, no annotations, no output schema), the description provides meaningful context via examples and the replay_window reference. It doesn't explain the exact format of param_overrides or return values, but the examples partially cover that, making it reasonably complete for an experienced agent.

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 0%, so the description must compensate. It clearly explains 'strategy' as a filter and 'param_overrides' as the counterfactual changes, with illustrative examples. The time parameters (from_ts_ns, to_ts_ns) are implicitly covered by 'same as replay_window,' which adds semantic context beyond the bare 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 clearly states 'Counterfactual replay' and positions it as a specialized variant of replay_window with a strategy-name filter and required param_overrides. The concrete examples ('what if EMA period was 50 instead of 21') make the tool's purpose unmistakable and distinguish it from siblings.

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 explicitly says 'same as replay_window plus a strategy-name filter and required param_overrides,' which tells the agent exactly how this tool differs from the base replay tool. It also provides 'Use for' scenarios that specify when to invoke it, making the selection criteria clear.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/FLOX-Foundation/flox'

If you have feedback or need assistance with the MCP directory API, please join our Discord server