{
  "tools": [
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [],
      "description": "Use after iterating on a strategy (multiple backtests, sweeps, walk-forward) to gauge overfitting risk. Looks at iteration trajectory, parameter sensitivity, and trade clustering. Requires at least one prior backtest.",
      "group": "assess",
      "inputSchema": {
        "properties": {
          "strategy_id": {
            "type": "string"
          }
        },
        "required": [
          "strategy_id"
        ],
        "type": "object"
      },
      "name": "assess_overfitting_risk",
      "page": "tools/assess_overfitting_risk.md",
      "relatedTools": [
        "compare_backtests",
        "walk_forward"
      ],
      "schema": "schemas/assess_overfitting_risk.json",
      "useAfter": [
        "run_backtest",
        "walk_forward"
      ],
      "workflowStage": "Validate"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [
        "builder_attach",
        "builder_compose"
      ],
      "description": "Add a condition card to the strategy. Returns card_id. Use multi-timeframe by setting 'resolution' inside lhs/rhs value refs. Use builder_get_card_schema('value_ref:indicator') for the full schema.",
      "group": "builder",
      "inputSchema": {
        "properties": {
          "condition": {
            "type": "object"
          },
          "strategy_id": {
            "type": "string"
          }
        },
        "required": [
          "strategy_id",
          "condition"
        ],
        "type": "object"
      },
      "name": "builder_add_condition",
      "page": "tools/builder_add_condition.md",
      "relatedTools": [
        "builder_get_card_schema",
        "builder_get_strategy"
      ],
      "schema": "schemas/builder_add_condition.json",
      "useAfter": [
        "builder_create",
        "builder_get_card_schema"
      ],
      "workflowStage": "Build"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [
        {
          "label": "Direction options",
          "sourceField": "direction",
          "values": [
            "long",
            "short"
          ]
        },
        {
          "label": "Role options",
          "sourceField": "role",
          "values": [
            "entry",
            "exit",
            "gate",
            "overlay"
          ]
        }
      ],
      "commonNext": [
        "builder_compile"
      ],
      "description": "Use after building a card to wire it into a strategy slot (entry, exit, gate, overlay). Each strategy needs at least one entry attachment to trade.",
      "group": "builder",
      "inputSchema": {
        "properties": {
          "card_id": {
            "type": "string"
          },
          "direction": {
            "enum": [
              "long",
              "short"
            ],
            "type": "string"
          },
          "role": {
            "enum": [
              "entry",
              "exit",
              "gate",
              "overlay"
            ],
            "type": "string"
          },
          "strategy_id": {
            "type": "string"
          }
        },
        "required": [
          "strategy_id",
          "card_id",
          "role"
        ],
        "type": "object"
      },
      "name": "builder_attach",
      "page": "tools/builder_attach.md",
      "relatedTools": [
        "builder_get_strategy"
      ],
      "schema": "schemas/builder_attach.json",
      "useAfter": [
        "builder_add_condition",
        "builder_compose"
      ],
      "workflowStage": "Build"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [
        "run_backtest"
      ],
      "description": "Use when ready to backtest: freeze a strategy into a runnable blueprint. Call after all entries/exits/gates have been attached and sizing/risk are configured. Idempotent.",
      "group": "builder",
      "inputSchema": {
        "properties": {
          "strategy_id": {
            "type": "string"
          }
        },
        "required": [
          "strategy_id"
        ],
        "type": "object"
      },
      "name": "builder_compile",
      "page": "tools/builder_compile.md",
      "relatedTools": [
        "builder_get_strategy"
      ],
      "schema": "schemas/builder_compile.json",
      "useAfter": [
        "builder_attach",
        "builder_set_strategy_config"
      ],
      "workflowStage": "Build"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [
        {
          "label": "Composition modes",
          "sourceField": "mode",
          "values": [
            "allOf",
            "anyOf",
            "not",
            "at_least",
            "consecutive",
            "sequence"
          ]
        }
      ],
      "commonNext": [
        "builder_attach"
      ],
      "description": "Use to combine multiple existing condition cards into one logical card. Modes: allOf (AND), anyOf (OR), not, at_least (N-of-M), consecutive (N bars), sequence (ordered steps).",
      "group": "builder",
      "inputSchema": {
        "properties": {
          "condition_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "mode": {
            "type": "string"
          },
          "strategy_id": {
            "type": "string"
          }
        },
        "required": [
          "strategy_id",
          "mode",
          "condition_ids"
        ],
        "type": "object"
      },
      "name": "builder_compose",
      "page": "tools/builder_compose.md",
      "relatedTools": [
        "builder_get_strategy"
      ],
      "schema": "schemas/builder_compose.json",
      "useAfter": [
        "builder_add_condition"
      ],
      "workflowStage": "Build"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [
        "builder_add_condition",
        "builder_set_strategy_config"
      ],
      "description": "Use FIRST when starting a new strategy. Returns a strategy_id used by every subsequent builder_* call. Pick `symbols` and `timeframe` from list_assets() to ensure data coverage. `symbols` is a list \u2014 single-symbol: ['SPY']; universe: ['AAPL','MSFT','GOOG']. Example: builder_create(name='RSI mean revert', symbols=['BTC-USD'], timeframe='1h', parent_strategy_id='root').",
      "group": "builder",
      "inputSchema": {
        "properties": {
          "name": {
            "type": "string"
          },
          "parent_strategy_id": {
            "type": "string"
          },
          "symbols": {
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "type": "array"
          },
          "timeframe": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "symbols",
          "timeframe"
        ],
        "type": "object"
      },
      "name": "builder_create",
      "page": "tools/builder_create.md",
      "relatedTools": [
        "builder_get_card_schema"
      ],
      "schema": "schemas/builder_create.json",
      "useAfter": [
        "list_assets",
        "project_create"
      ],
      "workflowStage": "Build"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [
        {
          "label": "Role options",
          "sourceField": "role",
          "values": [
            "entry",
            "exit",
            "gate"
          ]
        }
      ],
      "commonNext": [
        "builder_add_condition"
      ],
      "description": "Use BEFORE builder_add_condition to discover and inspect card types. Call with no card_type (optionally with role=entry/exit/gate) to list all available types grouped by category. Call with a specific card_type (e.g. 'trailing_stop', 'value_ref:indicator') to get its full JSON schema.",
      "group": "builder",
      "inputSchema": {
        "properties": {
          "card_type": {
            "type": "string"
          },
          "role": {
            "enum": [
              "entry",
              "exit",
              "gate"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "name": "builder_get_card_schema",
      "page": "tools/builder_get_card_schema.md",
      "relatedTools": [
        "builder_create"
      ],
      "schema": "schemas/builder_get_card_schema.json",
      "useAfter": [
        "list_assets"
      ],
      "workflowStage": "Discover"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [
        "builder_compile"
      ],
      "description": "Set strategy-level config (sizing, position_policy, execution, risk) in one partial-patch call. Only keys present in patch are applied.",
      "group": "builder",
      "inputSchema": {
        "properties": {
          "patch": {
            "type": "object"
          },
          "strategy_id": {
            "type": "string"
          }
        },
        "required": [
          "strategy_id",
          "patch"
        ],
        "type": "object"
      },
      "name": "builder_set_strategy_config",
      "page": "tools/builder_set_strategy_config.md",
      "relatedTools": [
        "builder_get_strategy"
      ],
      "schema": "schemas/builder_set_strategy_config.json",
      "useAfter": [
        "builder_create"
      ],
      "workflowStage": "Configure"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [],
      "description": "Compare statistics across multiple backtests. Useful for evaluating parameter sweeps or different strategy configurations. Pass 2-10 backtest_ids.",
      "group": "compare",
      "inputSchema": {
        "properties": {
          "backtest_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "backtest_ids"
        ],
        "type": "object"
      },
      "name": "compare_backtests",
      "page": "tools/compare_backtests.md",
      "relatedTools": [
        "assess_overfitting_risk",
        "walk_forward"
      ],
      "schema": "schemas/compare_backtests.json",
      "useAfter": [
        "run_backtest"
      ],
      "workflowStage": "Diagnose"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [],
      "description": "Explain what happened on a single bar. Returns had_entry=true with the full entry payload (trade index, prices, PnL, exit reason, per-condition state at the signal bar) if an entry fired, otherwise had_entry=false with which entry conditions failed and how close they were. Pass exactly one of bar_id or timestamp.",
      "group": "explain",
      "inputSchema": {
        "properties": {
          "backtest_id": {
            "type": "string"
          },
          "bar_id": {
            "type": "integer"
          },
          "timestamp": {
            "type": "string"
          }
        },
        "required": [
          "backtest_id"
        ],
        "type": "object"
      },
      "name": "explain_bar",
      "page": "tools/explain_bar.md",
      "relatedTools": [
        "get_condition_timeline"
      ],
      "schema": "schemas/explain_bar.json",
      "useAfter": [
        "run_backtest"
      ],
      "workflowStage": "Diagnose"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [],
      "description": "Get condition proximity evolution over a bar range. Use to spot patterns like 'RSI was consistently near threshold but never crossed'.",
      "group": "get",
      "inputSchema": {
        "properties": {
          "backtest_id": {
            "type": "string"
          }
        },
        "required": [
          "backtest_id"
        ],
        "type": "object"
      },
      "name": "get_condition_timeline",
      "page": "tools/get_condition_timeline.md",
      "relatedTools": [
        "explain_bar"
      ],
      "schema": "schemas/get_condition_timeline.json",
      "useAfter": [
        "run_backtest"
      ],
      "workflowStage": "Diagnose"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [],
      "description": "Evaluate a strategy's entry/exit conditions against the most recent market bar. Use before promoting to paper trading to confirm the strategy isn't already firing on stale signals.",
      "group": "get",
      "inputSchema": {
        "properties": {
          "strategy_id": {
            "type": "string"
          }
        },
        "required": [
          "strategy_id"
        ],
        "type": "object"
      },
      "name": "get_current_signal_state",
      "page": "tools/get_current_signal_state.md",
      "relatedTools": [
        "signal_scan"
      ],
      "schema": "schemas/get_current_signal_state.json",
      "useAfter": [
        "builder_compile"
      ],
      "workflowStage": "Deploy"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [
        "builder_create",
        "signal_scan"
      ],
      "description": "Use BEFORE creating a strategy to see what symbols, timeframes, and date ranges are available for backtesting. Returns a catalog of assets with data coverage. Call once at the start of a research session to ground subsequent builder_create calls.",
      "group": "list",
      "inputSchema": {
        "properties": {},
        "type": "object"
      },
      "name": "list_assets",
      "page": "tools/list_assets.md",
      "relatedTools": [
        "builder_get_card_schema"
      ],
      "schema": "schemas/list_assets.json",
      "useAfter": [],
      "workflowStage": "Discover"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [
        "builder_add_condition"
      ],
      "description": "Use BEFORE adding an event-driven condition (e.g. \"exit before FOMC\"). Returns the user's custom events plus active system events (CPI, FOMC, NFP, earnings windows).",
      "group": "list",
      "inputSchema": {
        "properties": {},
        "type": "object"
      },
      "name": "list_event_types",
      "page": "tools/list_event_types.md",
      "relatedTools": [
        "builder_get_card_schema"
      ],
      "schema": "schemas/list_event_types.json",
      "useAfter": [],
      "workflowStage": "Discover"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [
        "builder_create"
      ],
      "description": "Use at the START of a research effort to group related strategies under one thesis. Created strategies link to the project via project_id on builder_create.",
      "group": "project",
      "inputSchema": {
        "properties": {
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "name": "project_create",
      "page": "tools/project_create.md",
      "relatedTools": [
        "list_assets"
      ],
      "schema": "schemas/project_create.json",
      "useAfter": [],
      "workflowStage": "Organize"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [
        "compare_backtests",
        "walk_forward",
        "assess_overfitting_risk"
      ],
      "description": "Run a backtest against a compiled strategy. Workflows: single-run with `lookback` or sweep across parameter variants. Example: run_backtest(strategy_id, lookback='3mo').",
      "group": "run",
      "inputSchema": {
        "properties": {
          "end_date": {
            "type": "string"
          },
          "lookback": {
            "type": "string"
          },
          "start_date": {
            "type": "string"
          },
          "strategy_id": {
            "type": "string"
          }
        },
        "required": [
          "strategy_id"
        ],
        "type": "object"
      },
      "name": "run_backtest",
      "page": "tools/run_backtest.md",
      "relatedTools": [
        "explain_bar",
        "get_condition_timeline"
      ],
      "schema": "schemas/run_backtest.json",
      "useAfter": [
        "builder_compile"
      ],
      "workflowStage": "Test"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [
        "builder_create"
      ],
      "description": "Use BEFORE building a strategy to test whether a condition has predictive power. Scan a single condition (or sweep variants) on one or more symbols and measure forward-return statistics. The signal-first workflow.",
      "group": "signal",
      "inputSchema": {
        "properties": {
          "condition": {
            "type": "object"
          },
          "symbols": {
            "type": "array"
          }
        },
        "required": [
          "condition"
        ],
        "type": "object"
      },
      "name": "signal_scan",
      "page": "tools/signal_scan.md",
      "relatedTools": [
        "get_current_signal_state"
      ],
      "schema": "schemas/signal_scan.json",
      "useAfter": [
        "list_assets"
      ],
      "workflowStage": "Research"
    },
    {
      "access": "Write",
      "annotations": {},
      "capabilities": [],
      "commonNext": [
        "assess_overfitting_risk"
      ],
      "description": "Validate a strategy's robustness via walk-forward analysis. Detects overfitting via the walk-forward efficiency (WFE) metric.",
      "group": "walk",
      "inputSchema": {
        "properties": {
          "strategy_id": {
            "type": "string"
          }
        },
        "required": [
          "strategy_id"
        ],
        "type": "object"
      },
      "name": "walk_forward",
      "page": "tools/walk_forward.md",
      "relatedTools": [
        "compare_backtests"
      ],
      "schema": "schemas/walk_forward.json",
      "useAfter": [
        "run_backtest"
      ],
      "workflowStage": "Validate"
    }
  ]
}
