Skip to main content
Glama

start_regime_optimization

Run QuanterLab's regime-aware threshold optimization.

    Adaptive threshold optimization via HMM regime detection plus
    per-regime grid search. Long-running (typically 2-10 min). Returns
    `{task_id, status, kind, dashboard_url}`; `get_regime_optimization_progress`
    reports progress and, when the run has finished, carries `result`.

    Every account runs it within a daily allowance; a refused call does not count, and get_started and
    every run's answer give today's count.

    Args:
        ticker: Asset to analyze.
        base_config: Strategy template, the same shape as
            `start_backtest`'s arguments (entry/exit indicators and
            conditions).
        param_x / param_y: The two settings to grid over, each
            `{"name": ..., "min": ..., "max": ...}` with an optional
            "steps" (2-30; default `grid_steps`). "name" is one of:
              "entry.length"         a setting of the entry, exit or
                                     confirmation indicator ("exit.fast")
              "rsi.length"           the same, found by the indicator's id
                                     when exactly one lane uses it
              "entry.conditions[0]"  the number an entry, exit or
                                     confirmation condition compares against
            Indicator settings move in whole numbers: a decimal setting
            (Bollinger's std) runs at each whole number inside its range
            (a range holding fewer than two answers with QuanterLab's note
            and the nearest version, one tap), and a rule of the same lane
            written against the swept indicator's column runs written the
            other way round, the same rule; the answer's `changed` says so
            in one line. A rule of
            another lane that reads the swept column is refused with what
            to change.
        duration: Historical window (default '5y').
        n_regimes: 0 to pick the number of regimes automatically (default),
            or 2-4.
        mode: 'all' (default) | 'static' | 'per_regime' | 'dynamic_mean' |
            'regression', the optimizers QuanterLab's regime page offers.
        objective: Metric to maximize per regime: 'sharpe' (default) |
            'total_return_pct' | 'profit_factor'.
        question: Optional. One sentence restating what the run should answer, not the person's
            message: the title of the report the finished run becomes, and kept only as that.

    A run of more than 500 backtests (in every outer window, the grid on all its days, the grid again for
    each market state, and one test) runs nothing and answers with QuanterLab's note and the nearest versions
    that run whole, one tap each. The default grid of 4 by 4 runs whole on the default five years.

    When the run has finished, its progress answer also carries `report_url`: the run written up as a
    QuanterLab report (the setting each market state picked, the rules side by side against holding the
    stock). The call waits for the run while it is likely to finish inside it; the run's card in the chat
    shows the result or, for a longer run, how far it is, and fills in by itself, with the next steps as
    choices and the report link. A run started here needs no `show_report_card`.
    

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "ticker": "<ticker>",
      "base_config": "<base_config>",
      "param_x": "<param_x>",
      "param_y": "<param_y>"
    },
    "name": "start_regime_optimization"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoall
tickerYes
param_xYes
param_yYes
durationNo5y
questionNo
n_regimesNo
objectiveNosharpe
timeframeNo1d
grid_stepsNo
base_configYes
outer_opt_barsNo
outer_step_barsNo
outer_test_barsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Annotations declare mutation and open-world behavior, and the description adds substantial context: long runtime, return fields, daily allowance with refused calls not counting, the >500-backtest refusal behavior, and that the call waits while the run is likely to finish. It also explains card auto-fill and report generation, filling gaps annotations leave open.

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

Conciseness3/5

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

The description is front-loaded with purpose and structured with an Args section, appropriate for a 14-parameter tool. But several sentences are convoluted, especially the explanation of indicator settings and same-lane rules, reducing clarity and making the definition longer than necessary.

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?

No output schema exists, so the description must explain returns; it does so by naming {task_id, status, kind, dashboard_url}, result on progress, and report_url after completion. It also covers runtime, allowance, and refusal conditions, though missing explanations for several optional parameters keep it from being fully complete.

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 coverage is 0%, so the description carries full burden. It thoroughly documents ticker, base_config, param_x/param_y, duration, n_regimes, mode, objective, and question, including enum-like values and param_x/y structure. However, five parameters—timeframe, grid_steps (only indirectly referenced), outer_opt_bars, outer_step_bars, and outer_test_bars—are never explained, leaving significant gaps.

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 QuanterLab's regime-aware threshold optimization', then specifies HMM regime detection plus per-regime grid search. This clearly distinguishes it from sibling analysis tools by emphasizing optimization and grid search rather than analysis.

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?

Provides clear operational context: long-running (2-10 min), progress via get_regime_optimization_progress, daily allowance, and that a run started here needs no show_report_card. It does not explicitly state when to prefer this over start_regime_analysis or start_backtest beyond the optimization framing.

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