Skip to main content
Glama

build_strategy_for_regime

Run the Strategy Engine route in one call. Use it FIRST whenever someone asks to build or make a strategy and names no signals -- 'build me a strategy', 'build me a BTC strategy on 1h', 'make me something for ETH'. Give the asset, and the candle size only when they named one, and min_days only when they asked for a specific minimum backtest history, e.g. strategies proven on 90-day backtests. The server reads the 180-day regime, searches the engine's completed runs once with the agreed floors (more than 10 trades, Sharpe at least 1, IRR at least 10%, beats benchmarks) in that regime, keeps the runs whose entry the regime admits, picks one at random, saves it from its own run and backtests it on recent data ending today, over a window its candle size sets: 5m 1 month, 15m 2 months, 30m 3 months, 1h 4 months, 4h 12 months, 1d 12 months (a month is 30 days). Returns as soon as the backtest is submitted; when running, show the saved strategy and invite the person to check results shortly using get_backtest with the returned backtest_id. Do not submit another backtest. Do not pass filters, a regime or dates: they are fixed. Without min_days the engine applies its default minimum backtest history; filters.min_days reports the minimum applied, and when it was the default, tell the person it applied and that they can ask for a shorter one. When nothing fits it answers with outcome no_match and saves and spends nothing. A fresh build selects its market automatically; do not ask for a venue or quote. It does not search the marketplace.

[Access: pay 0.10 USDC via x402 (PAYMENT-SIGNATURE header) OR authenticate with an API key. An x402-capable client will auto-pay; API-key clients pay nothing per call.]

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": {
      "asset": "<asset>"
    },
    "name": "build_strategy_for_regime"
  }
}

Input Schema

NameRequiredDescriptionDefault
assetYesAsset symbol, e.g. BTC or ETH.
min_daysNoMinimum recorded backtest days, inclusive. An explicit value overrides the conditional IRR duration default, including zero.
candle_sizeNoDuration of one candle, e.g. 1h or 1d.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / min_days
      Added value: +{
      +  "description": "Minimum recorded backtest days, inclusive. An explicit value overrides the conditional IRR duration default, including zero.",
      +  "type": "integer"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare this is a non-read-only, open-world, non-idempotent mutation, which is a low bar; the description goes far beyond by disclosing the whole pipeline (reads 180-day regime, searches completed runs against stated floors, keeps regime-admitted entries, picks randomly, saves and backtests on recent data), the per-candle-size backtest windows, early return on submission, and that no_match saves and spends nothing. The payment/access block also discloses that a call costs 0.10 USDC or is free with an API key, which is material behavior not covered by annotations.

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?

Front-loaded with the imperative usage rule before any mechanics, and nearly every sentence carries operational information. It is dense and long for a three-parameter tool, with a couple of restatements (the 'do not pass filters/regime/dates' constraint is echoed later) and an embedded payment notice that pads the block slightly.

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 no output schema, the description must carry return semantics and does: it states the call returns at submission time with a backtest_id, surfaces outcome 'no_match' as a terminal case, and points to filters.min_days in the response. Combined with the regime/threshold pipeline and the instruction to show the saved strategy, an agent has enough to call this correctly and report results without guessing.

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 nonetheless adds real meaning, telling the agent to supply candle_size only when the user named one, to supply min_days only when a specific minimum history was requested, and that an explicit min_days overrides the conditional IRR duration default. It also explains the downstream effect of candle_size (5m→1 month, 1h→4 months, 1d→12 months) and that filters.min_days reports the applied minimum, none of which is derivable from the 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?

Opens with a specific verb and resource ('Run the Strategy Engine route in one call') and immediately scopes the case it serves: building a strategy when no signals are named. It is clearly distinguishable from siblings like save_strategy, find_sweep_runs or get_backtest because it explains that the server itself selects, saves and backtests a run.

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?

Gives an explicit trigger ('Use it FIRST whenever someone asks to build or make a strategy and names no signals') with concrete example phrasings, plus explicit exclusions: do not pass filters, a regime or dates; do not ask for a venue or quote; do not submit another backtest; it does not search the marketplace. It also routes the follow-up step to the named sibling get_backtest with the returned backtest_id.

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.