Skip to main content
Glama

run_backtest

Backtest an Indian index option strategy on real 1-minute NIFTY options data. Returns P&L after real charges and slippage, return-on-margin, and an honesty panel: out-of-sample split, walk-forward folds, bootstrap interval, and a deflated Sharpe that accounts for how many variants you have already tried. Refuses windows too narrow to be meaningful, and reports no ratios below 30 trades. Two spec forms: a PRESET (structure + params) for the common shapes, or an OPEN STRATEGY (legs + rules) for anything else — any number of legs at any strikes on any expiry, strikes chosen by percent, points, premium or delta, entry at any minute, and rules that CHANGE the position while it is live (roll a tested leg, close one side, add a hedge, trail a stop) plus book-level rules like standing down after three losers. Nothing here is restricted by tier; a paid tier only widens the date window.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lotsNo
specYesEither a preset spec (structure + params) or an open strategy (legs + rules). Use the open form for anything the presets cannot say.
detailNoHow much per-trade data to return. 'standard' (default) is the equity curve, breakdowns and the first 25 trades with their leg prices. 'full' returns up to 300 trades — ask for it when the caller wants to audit or chart every trade. 'summary' returns aggregates only, and is the cheapest to read.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
specNo
quotaNo
tradesNo
honestyNo
summaryNo
breakdownNo
report_urlNo
backtest_idNo
methodologyNo
cost_secondsNo
data_releaseNo
equity_curveNo
trade_detailNo
strategy_bookNo
interpretationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / spec / oneOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "bias": {
      -        "description": "Chooses the side each cycle for directional structures. 'neutral' to use a fixed direction instead.",
      -        "type": "string"
      -      },
      -      "cadence": {
      -        "description": "'weekly' (default) enters ONCE per expiry, on the day matching entry_dte — about 58 trades a year. 'daily' enters EVERY trading session on whichever expiry is nearest — about 246. Use 'daily' for anything described as 'every day'.",
      -        "enum": [
      -          "weekly",
      -          "daily"
      -        ],
      -        "type": "string"
      -      },
      -      "entry_time": {
      -        "description": "IST. EOD is 15:29, the last tradeable minute.",
      -        "enum": [
      -          "09:15",
      -          "09:30",
      -          "11:00",
      -          "12:00",
      -          "12:30",
      -          "13:00",
      -          "14:00",
      -          "15:00",
      -          "EOD"
      -        ],
      -        "type": "string"
      -      },
      -      "exit_time": {
      -        "description": "IST clock exit — squares the position off the SAME session, so it never reaches expiry. Omit to hold until a stop, a target or settlement. Must be after entry_time. Set this to express an intraday round trip such as in at 11:00, out at 14:00.",
      -        "enum": [
      -          "09:15",
      -          "09:30",
      -          "11:00",
      -          "12:00",
      -          "12:30",
      -          "13:00",
      -          "14:00",
      -          "15:00",
      -          "EOD"
      -        ],
      -        "type": "string"
      -      },
      -      "gate": {
      -        "description": "Entry filter; 'always' to disable.",
      -        "type": "string"
      -      },
      -      "max_dte": {
      -        "description": "cadence 'daily' only: skip sessions where the nearest expiry is further out than this. max_dte 0 is expiry-day only.",
      -        "maximum": 45,
      -        "minimum": 0,
      -        "type": "integer"
      -      },
      -      "overlay": {
      -        "description": "Volatility filter: 'vol20' skips a cycle when the index's 20-day realised volatility is above 20% at entry. Omit for none.",
      -        "pattern": "^vol[0-9]{1,3}$",
      -        "type": "string"
      -      },
      -      "params": {
      -        "description": "Structure parameters. pct_offset and pct_width are percent of spot. sl_mult is a multiple of the credit received; sl_pct and tp_pct are fractions of premium paid. entry_dte is days to expiry at entry. direction is CE or PE for directional structures, and must be omitted when a bias is set.",
      -        "properties": {
      -          "direction": {
      -            "enum": [
      -              "CE",
      -              "PE"
      -            ],
      -            "type": "string"
      -          },
      -          "entry_days_before": {
      -            "description": "Entry day as TRADING SESSIONS before expiry (0 = expiry day, 2 = 'T-2'), instead of calendar entry_dte. Set one or the other.",
      -            "maximum": 30,
      -            "minimum": 0,
      -            "type": "integer"
      -          },
      -          "entry_dte": {
      -            "maximum": 45,
      -            "minimum": 0,
      -            "type": "integer"
      -          },
      -          "pct_offset": {
      -            "maximum": 20,
      -            "minimum": 0,
      -            "type": "number"
      -          },
      -          "pct_width": {
      -            "maximum": 20,
      -            "minimum": 0,
      -            "type": "number"
      -          },
      -          "sl_mult": {
      -            "exclusiveMinimum": 0,
      -            "type": "number"
      -          },
      -          "sl_pct": {
      -            "exclusiveMinimum": 0,
      -            "maximum": 1,
      -            "type": "number"
      -          },
      -          "tp_pct": {
      -            "exclusiveMinimum": 0,
      -            "type": "number"
      -          }
      -        },
      -        "type": "object"
      -      },
      -      "period": {
      -        "additionalProperties": false,
      -        "description": "YYYY-MM-DD, inside 2025-07-01 to 2026-06-30.",
      -        "properties": {
      -          "from": {
      -            "type": "string"
      -          },
      -          "to": {
      -            "type": "string"
      -          }
      -        },
      -        "type": "object"
      -      },
      -      "structure": {
      -        "description": "Option structure to trade.",
      -        "enum": [
      -          "credit_spread",
      -          "iron_condor",
      -          "iron_fly",
      -          "long_option",
      -          "short_strangle"
      -        ],
      -        "type": "string"
      -      },
      -      "symbol": {
      -        "description": "Free tier serves NIFTY only.",
      -        "enum": [
      -          "NIFTY"
      -        ],
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "structure",
      -      "params"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "description": "An open strategy: any legs, any rules. Use this whenever the idea does not fit a preset — ratio spreads, calendars, diagonals, jade lizards, broken wings, delta- or premium-selected strikes, per-leg stops, rolling a tested side, trailing stops, entry conditions on the credit available, and book-level rules like standing down after three losers.",
      -    "properties": {
      -      "entry": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "cadence": {
      -            "description": "weekly = one entry per weekly expiry; monthly = one per monthly expiry (the last of its calendar month); daily = one per session.",
      -            "enum": [
      -              "weekly",
      -              "daily",
      -              "monthly"
      -            ],
      -            "type": "string"
      -          },
      -          "dte": {
      -            "description": "weekly/monthly only: days before expiry to enter. Defaults to 4 weekly, 21 monthly.",
      -            "maximum": 60,
      -            "minimum": 0,
      -            "type": "integer"
      -          },
      -          "max_dte": {
      -            "description": "daily only: skip sessions further than this from expiry.",
      -            "maximum": 60,
      -            "minimum": 0,
      -            "type": "integer"
      -          },
      -          "time": {
      -            "description": "ANY minute of the session, e.g. '09:20'. Not a grid.",
      -            "type": "string"
      -          },
      -          "when": {
      -            "description": "Optional gate on the cycle — the REASON for taking the trade. combined_premium is the credit on offer, so {\"combined_premium\": {\"gte\": 80}} means 'only if I collect 80 points'. Market state is here too: day_of_week, gap_pct, prev_day_move_pct, realised_vol_20d, vix, vix_change_pct, vix_prev_close. e.g. {\"vix\": {\"gte\": 15}}, {\"prev_day_move_pct\": {\"lte\": -1}}, {\"day_of_week\": {\"eq\": 1}} for Mondays. INDEX INDICATORS too, computed on closes up to YESTERDAY: rsi_N (0-100), close_vs_sma_N_pct and close_vs_ema_N_pct (per cent above/below the N-day average), ema_F_vs_S_pct and sma_F_vs_S_pct (fast against slow, positive = fast is above). N from 2 to 250. e.g. {\"rsi_14\": {\"lt\": 30}} for oversold, {\"close_vs_ema_50_pct\": {\"gt\": 0}} for 'above the 50-day', {\"ema_9_vs_21_pct\": {\"gt\": 0}} for a 9/21 crossover. All are knowable before the session — none can see the day's own close.",
      -            "type": "object"
      -          }
      -        },
      -        "type": "object"
      -      },
      -      "exit": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "time": {
      -            "description": "hard square-off at this minute on the entry day.",
      -            "type": "string"
      -          },
      -          "when": {
      -            "type": "object"
      -          }
      -        },
      -        "type": "object"
      -      },
      -      "legs": {
      -        "description": "What to open. Leg order defines the indices rules use.",
      -        "items": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "expiry": {
      -              "description": "'near' is the nearest expiry at entry; 'next' is the one after, which is how a calendar or diagonal is written.",
      -              "enum": [
      -                "near",
      -                "next",
      -                "far"
      -              ],
      -              "type": "string"
      -            },
      -            "label": {
      -              "type": "string"
      -            },
      -            "qty": {
      -              "description": "lots of THIS leg relative to the others. Unequal quantities are how a ratio spread is written.",
      -              "maximum": 100,
      -              "minimum": 1,
      -              "type": "integer"
      -            },
      -            "side": {
      -              "enum": [
      -                "sell",
      -                "buy"
      -              ],
      -              "type": "string"
      -            },
      -            "strike": {
      -              "description": "How to pick the strike. One of: {\"pct_offset\": 1.0} percent from spot (negative for puts) | {\"points_offset\": 200} | \"atm\" | {\"strike\": 24000} | {\"premium_near\": 50} the strike whose last real print is nearest 50 points | {\"delta_near\": 0.20} | {\"from_leg\": {\"leg\": 0, \"pct\": 0.5}} relative to another leg. Add {\"ref\": \"entry\"} to measure from the spot at entry rather than the spot now."
      -            },
      -            "type": {
      -              "enum": [
      -                "CE",
      -                "PE"
      -              ],
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "side",
      -            "type",
      -            "strike"
      -          ],
      -          "type": "object"
      -        },
      -        "maxItems": 12,
      -        "minItems": 1,
      -        "type": "array"
      -      },
      -      "max_adjustments": {
      -        "description": "how many times the rules may change the position in one trade. Default 4.",
      -        "maximum": 50,
      -        "minimum": 0,
      -        "type": "integer"
      -      },
      -      "name": {
      -        "type": "string"
      -      },
      -      "period": {
      -        "additionalProperties": false,
      -        "properties": {
      -          "from": {
      -            "type": "string"
      -          },
      -          "to": {
      -            "type": "string"
      -          }
      -        },
      -        "type": "object"
      -      },
      -      "portfolio": {
      -        "additionalProperties": false,
      -        "description": "Rules over the SEQUENCE of trades, which no per-trade condition can express.",
      -        "properties": {
      -          "max_trades": {
      -            "minimum": 1,
      -            "type": "integer"
      -          },
      -          "skip_after_loss": {
      -            "type": "boolean"
      -          },
      -          "stop_after_drawdown_pct": {
      -            "type": "number"
      -          },
      -          "stop_after_losses": {
      -            "minimum": 1,
      -            "type": "integer"
      -          },
      -          "stop_after_profit_pct": {
      -            "type": "number"
      -          }
      -        },
      -        "type": "object"
      -      },
      -      "resolution": {
      -        "description": "minutes per rule check. 1 is the default and the honest one.",
      -        "enum": [
      -          1,
      -          5,
      -          15
      -        ],
      -        "type": "integer"
      -      },
      -      "rules": {
      -        "description": "Checked every minute, in order; the first match fires. Fields: adjustments_done, combined_premium, credit_kept_pct, day_of_week, drawdown_from_peak, dte, gap_pct, leg_mark, leg_mark_delta, leg_mark_mult, leg_pnl_pts, minutes_held, pnl_pct_of_credit, pnl_pct_of_max, pnl_pts, pnl_rupees, prev_day_move_pct, realised_vol_20d, runup_from_trough, spot, spot_beyond_strike, spot_move_pct, spot_move_pts, time, vix, vix_change_pct, vix_prev_close. Actions: \"close\" | {\"close_legs\": [0]} | {\"open\": [leg,...]} | {\"roll\": {\"legs\": [0], \"to\": strike}} | {\"close_and_open\": {\"close\": [0], \"open\": [leg]}}.",
      -        "items": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "label": {
      -              "type": "string"
      -            },
      -            "max_times": {
      -              "maximum": 100,
      -              "minimum": 1,
      -              "type": "integer"
      -            },
      -            "then": {},
      -            "when": {
      -              "type": "object"
      -            }
      -          },
      -          "required": [
      -            "when",
      -            "then"
      -          ],
      -          "type": "object"
      -        },
      -        "maxItems": 24,
      -        "type": "array"
      -      },
      -      "symbol": {
      -        "enum": [
      -          "NIFTY"
      -        ],
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "legs"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "bias": {
      +        "description": "Chooses the side each cycle for directional structures. 'neutral' to use a fixed direction instead.",
      +        "type": "string"
      +      },
      +      "cadence": {
      +        "description": "'weekly' (default) enters ONCE per expiry, on the day matching entry_dte — about 58 trades a year. 'daily' enters EVERY trading session on whichever expiry is nearest — about 246. Use 'daily' for anything described as 'every day'.",
      +        "enum": [
      +          "weekly",
      +          "daily"
      +        ],
      +        "type": "string"
      +      },
      +      "entry_time": {
      +        "description": "IST. EOD is 15:29, the last tradeable minute.",
      +        "enum": [
      +          "09:15",
      +          "09:30",
      +          "11:00",
      +          "12:00",
      +          "12:30",
      +          "13:00",
      +          "14:00",
      +          "15:00",
      +          "EOD"
      +        ],
      +        "type": "string"
      +      },
      +      "exit_time": {
      +        "description": "IST clock exit — squares the position off the SAME session, so it never reaches expiry. Omit to hold until a stop, a target or settlement. Must be after entry_time. Set this to express an intraday round trip such as in at 11:00, out at 14:00.",
      +        "enum": [
      +          "09:15",
      +          "09:30",
      +          "11:00",
      +          "12:00",
      +          "12:30",
      +          "13:00",
      +          "14:00",
      +          "15:00",
      +          "EOD"
      +        ],
      +        "type": "string"
      +      },
      +      "gate": {
      +        "description": "Entry filter; 'always' to disable.",
      +        "type": "string"
      +      },
      +      "max_dte": {
      +        "description": "cadence 'daily' only: skip sessions where the nearest expiry is further out than this. max_dte 0 is expiry-day only.",
      +        "maximum": 45,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "overlay": {
      +        "description": "Volatility filter: 'vol20' skips a cycle when the index's 20-day realised volatility is above 20% at entry. Omit for none.",
      +        "pattern": "^vol[0-9]{1,3}$",
      +        "type": "string"
      +      },
      +      "params": {
      +        "description": "Structure parameters. pct_offset and pct_width are percent of spot. sl_mult is a multiple of the credit received; sl_pct and tp_pct are fractions of premium paid. entry_dte is days to expiry at entry. direction is CE or PE for directional structures, and must be omitted when a bias is set.",
      +        "properties": {
      +          "direction": {
      +            "enum": [
      +              "CE",
      +              "PE"
      +            ],
      +            "type": "string"
      +          },
      +          "entry_days_before": {
      +            "description": "Entry day as TRADING SESSIONS before expiry (0 = expiry day, 2 = 'T-2'), instead of calendar entry_dte. Set one or the other.",
      +            "maximum": 30,
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "entry_dte": {
      +            "maximum": 45,
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "pct_offset": {
      +            "maximum": 20,
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "pct_width": {
      +            "maximum": 20,
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          "sl_mult": {
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          },
      +          "sl_pct": {
      +            "exclusiveMinimum": 0,
      +            "maximum": 1,
      +            "type": "number"
      +          },
      +          "tp_pct": {
      +            "exclusiveMinimum": 0,
      +            "type": "number"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "period": {
      +        "additionalProperties": false,
      +        "description": "YYYY-MM-DD, inside 2025-07-01 to 2026-06-30.",
      +        "properties": {
      +          "from": {
      +            "type": "string"
      +          },
      +          "to": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "structure": {
      +        "description": "Option structure to trade.",
      +        "enum": [
      +          "credit_spread",
      +          "iron_condor",
      +          "iron_fly",
      +          "long_option",
      +          "short_strangle"
      +        ],
      +        "type": "string"
      +      },
      +      "symbol": {
      +        "description": "Free tier serves NIFTY only.",
      +        "enum": [
      +          "NIFTY"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "structure",
      +      "params"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "description": "An open strategy: any legs, any rules. Covers what the presets cannot say — ratio spreads, calendars, diagonals, jade lizards, broken wings, delta- or premium-selected strikes, per-leg stops, rolling a tested side, trailing stops, entry conditions on the credit available, and book-level rules like standing down after three losers.",
      +    "properties": {
      +      "entry": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "cadence": {
      +            "description": "weekly = one entry per weekly expiry; monthly = one per monthly expiry (the last of its calendar month); daily = one per session.",
      +            "enum": [
      +              "weekly",
      +              "daily",
      +              "monthly"
      +            ],
      +            "type": "string"
      +          },
      +          "dte": {
      +            "description": "weekly/monthly only: days before expiry to enter. Defaults to 4 weekly, 21 monthly.",
      +            "maximum": 60,
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "max_dte": {
      +            "description": "daily only: skip sessions further than this from expiry.",
      +            "maximum": 60,
      +            "minimum": 0,
      +            "type": "integer"
      +          },
      +          "time": {
      +            "description": "ANY minute of the session, e.g. '09:20'. Not a grid.",
      +            "type": "string"
      +          },
      +          "when": {
      +            "description": "Optional gate on the cycle — the REASON for taking the trade. combined_premium is the credit on offer, so {\"combined_premium\": {\"gte\": 80}} means 'only if I collect 80 points'. Market state is here too: day_of_week, gap_pct, prev_day_move_pct, realised_vol_20d, vix, vix_change_pct, vix_prev_close. e.g. {\"vix\": {\"gte\": 15}}, {\"prev_day_move_pct\": {\"lte\": -1}}, {\"day_of_week\": {\"eq\": 1}} for Mondays. INDEX INDICATORS too, computed on closes up to YESTERDAY: rsi_N (0-100), close_vs_sma_N_pct and close_vs_ema_N_pct (per cent above/below the N-day average), ema_F_vs_S_pct and sma_F_vs_S_pct (fast against slow, positive = fast is above). N from 2 to 250. e.g. {\"rsi_14\": {\"lt\": 30}} for oversold, {\"close_vs_ema_50_pct\": {\"gt\": 0}} for 'above the 50-day', {\"ema_9_vs_21_pct\": {\"gt\": 0}} for a 9/21 crossover. All are knowable before the session — none can see the day's own close.",
      +            "type": "object"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "exit": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "time": {
      +            "description": "hard square-off at this minute on the entry day.",
      +            "type": "string"
      +          },
      +          "when": {
      +            "type": "object"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "legs": {
      +        "description": "What to open. Leg order defines the indices rules use.",
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "expiry": {
      +              "description": "'near' is the nearest expiry at entry; 'next' is the one after, which is how a calendar or diagonal is written.",
      +              "enum": [
      +                "near",
      +                "next",
      +                "far"
      +              ],
      +              "type": "string"
      +            },
      +            "label": {
      +              "type": "string"
      +            },
      +            "qty": {
      +              "description": "lots of THIS leg relative to the others. Unequal quantities are how a ratio spread is written.",
      +              "maximum": 100,
      +              "minimum": 1,
      +              "type": "integer"
      +            },
      +            "side": {
      +              "enum": [
      +                "sell",
      +                "buy"
      +              ],
      +              "type": "string"
      +            },
      +            "strike": {
      +              "description": "How to pick the strike. One of: {\"pct_offset\": 1.0} percent from spot (negative for puts) | {\"points_offset\": 200} | \"atm\" | {\"strike\": 24000} | {\"premium_near\": 50} the strike whose last real print is nearest 50 points | {\"delta_near\": 0.20} | {\"from_leg\": {\"leg\": 0, \"pct\": 0.5}} relative to another leg. Add {\"ref\": \"entry\"} to measure from the spot at entry rather than the spot now."
      +            },
      +            "type": {
      +              "enum": [
      +                "CE",
      +                "PE"
      +              ],
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "side",
      +            "type",
      +            "strike"
      +          ],
      +          "type": "object"
      +        },
      +        "maxItems": 12,
      +        "minItems": 1,
      +        "type": "array"
      +      },
      +      "max_adjustments": {
      +        "description": "how many times the rules may change the position in one trade. Default 4.",
      +        "maximum": 50,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "name": {
      +        "type": "string"
      +      },
      +      "period": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "from": {
      +            "type": "string"
      +          },
      +          "to": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "portfolio": {
      +        "additionalProperties": false,
      +        "description": "Rules over the SEQUENCE of trades, which no per-trade condition can express.",
      +        "properties": {
      +          "max_trades": {
      +            "minimum": 1,
      +            "type": "integer"
      +          },
      +          "skip_after_loss": {
      +            "type": "boolean"
      +          },
      +          "stop_after_drawdown_pct": {
      +            "type": "number"
      +          },
      +          "stop_after_losses": {
      +            "minimum": 1,
      +            "type": "integer"
      +          },
      +          "stop_after_profit_pct": {
      +            "type": "number"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "resolution": {
      +        "description": "minutes per rule check. 1 is the default and the honest one.",
      +        "enum": [
      +          1,
      +          5,
      +          15
      +        ],
      +        "type": "integer"
      +      },
      +      "rules": {
      +        "description": "Checked every minute, in order; the first match fires. Fields: adjustments_done, combined_premium, credit_kept_frac, day_of_week, drawdown_from_peak, dte, gap_pct, leg_mark, leg_mark_delta, leg_mark_mult, leg_pnl_pts, minutes_held, pnl_frac_of_credit, pnl_frac_of_max, pnl_pts, pnl_rupees, prev_day_move_pct, realised_vol_20d, runup_from_trough, spot, spot_beyond_strike, spot_move_pct, spot_move_pts, time, vix, vix_change_pct, vix_prev_close. Actions: \"close\" | {\"close_legs\": [0]} | {\"open\": [leg,...]} | {\"roll\": {\"legs\": [0], \"to\": strike}} | {\"close_and_open\": {\"close\": [0], \"open\": [leg]}}.",
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "label": {
      +              "type": "string"
      +            },
      +            "max_times": {
      +              "maximum": 100,
      +              "minimum": 1,
      +              "type": "integer"
      +            },
      +            "then": {},
      +            "when": {
      +              "type": "object"
      +            }
      +          },
      +          "required": [
      +            "when",
      +            "then"
      +          ],
      +          "type": "object"
      +        },
      +        "maxItems": 24,
      +        "type": "array"
      +      },
      +      "symbol": {
      +        "enum": [
      +          "NIFTY"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "legs"
      +    ],
      +    "type": "object"
      +  }
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "backtest_id": {
      +      "type": "string"
      +    },
      +    "breakdown": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "cost_seconds": {
      +      "type": "number"
      +    },
      +    "data_release": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "equity_curve": {
      +      "type": "array"
      +    },
      +    "honesty": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "interpretation": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "methodology": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "quota": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "report_url": {
      +      "type": "string"
      +    },
      +    "spec": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "strategy_book": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "summary": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "trade_detail": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "trades": {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

The description discloses behavior far beyond the sparse annotations: it refuses too-narrow windows, suppresses ratios below 30 trades, applies real charges and slippage, reports a detailed honesty panel, and notes that tier only affects the date window. This gives the agent essential expectations about side effects, data realism, and statistical guardrails.

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?

The description is front-loaded with purpose and outputs, then moves through behavioral constraints, spec forms, and tier behavior. It is dense and somewhat run-on, but every clause adds a distinct fact needed to invoke the tool correctly. Restructuring into shorter sentences would improve scannability without cutting content.

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?

Given the complexity of the nested spec schema and the presence of an output schema, the description covers invocation-critical context thoroughly: minimum sample size, refusal conditions, data realism, result contents, tier limitations, and the boundary between preset and open strategies. Nothing essential appears missing for an agent deciding how to call it.

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?

The description adds meaningful high-level semantics for the `spec` parameter: preset versus open strategy, strike selection by percent/points/premium/delta, live-adjustment rules, and portfolio-level rules. However, the top-level `lots` parameter is not explained in either the schema or the description, leaving a small semantic gap.

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 first sentence names a specific action ('Backtest'), a specific resource ('Indian index option strategy on real 1-minute NIFTY options data'), and the key outputs (P&L after real charges and slippage, return-on-margin). This cleanly distinguishes run_backtest from retrieval siblings like get_backtest and list_backtests without forcing the agent to open the schema.

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?

The description gives clear guidance on choosing between the PRESET and OPEN strategy forms ('Use the open form for anything the presets cannot say') and explains scope/cadence choices such as any number of legs, live position-changing rules, and book-level rules. It does not explicitly name sibling tools or state when not to use run_backtest versus build_report/explain_methodology, but the use case is clear enough.

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