Skip to main content
Glama
@dwlf/mcp-server

@dwlf/mcp-server

by andywilliams

dwlf_run_backtest

Run an asynchronous strategy backtest for a DWLF strategy and return a request ID to poll for results; activate symbols and use a long enough date range to avoid zero-trade runs.

Instructions

⚠️ Run a strategy backtest (async). Returns requestId → poll with dwlf_get_backtest_results. PREREQUISITES: 1) Strategy MUST have symbols activated (dwlf_activate_strategy_symbols) or backtest returns 0 trades. 2) Requires 200+ daily candles: startDate must be 10+ months before endDate. If backtest returns 0 trades, check: a) Are symbols activated? b) Is date range long enough? c) Do event conditions actually match historical data? Optional capital/risk params (initialCapital, riskPerTrade, maxConcurrentTrades, portfolioMode, allowSymbolPyramiding) override backend defaults — set portfolioMode=true together with maxConcurrentTrades to model shared-capital concurrency across symbols; set allowSymbolPyramiding=true to permit more than one concurrent open position per symbol, and maxPositionsPerSymbol to bound that (e.g. 3) so per-symbol concentration stays capped. Set disableTakeProfit=true for exit-signal-only strategies (no tp node) so the backend does NOT force a fallback take-profit that would exit early.

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": {
      "strategyId": "<strategyId>"
    },
    "name": "dwlf_run_backtest"
  }
}

Input Schema

NameRequiredDescriptionDefault
symbolNoSingle symbol shorthand (e.g. BTC, TSLA). Use "symbols" for multiple.
endDateNoEnd date (YYYY-MM-DD)
symbolsNoSymbols to backtest against (e.g. ["BTC", "TSLA"]). Defaults to strategy assets.
startDateNoStart date (YYYY-MM-DD)
strategyIdYesStrategy ID to backtest
riskPerTradeNoRisk per trade as a decimal, e.g. 0.005 = 0.5% (default 0.02).
portfolioModeNoOpt into shared-capital simulation across symbols (default false). Combine with maxConcurrentTrades to cap simultaneous open positions.
initialCapitalNoStarting account size in USD (default 10000).
disableTakeProfitNoSuppress the implicit fallback take-profit (default false). When a strategy has NO take-profit node the backend otherwise force-applies a 3xATR fallback TP, which exits exit-signal-only strategies early. Set true to truly ride the exit graph (e.g. exit on cycle high / trendline break).
maxConcurrentTradesNoConcurrency cap for portfolio mode (default 3). Pair with portfolioMode=true.
allowSymbolPyramidingNoOpt into >1 concurrent open position per symbol in portfolio mode (default false = one position per symbol). Note: global maxConcurrentTrades still caps total positions, but per-symbol concentration is unbounded unless maxPositionsPerSymbol is set.
maxPositionsPerSymbolNoBound concurrent open positions per symbol when allowSymbolPyramiding=true (e.g. 3). Default unlimited. No effect when allowSymbolPyramiding is false (cap is 1 then).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.77.0

TDQS

A4.8/5.0
Behavior5/5

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

No annotations exist, so the description carries the full burden and does so: it discloses asynchronous execution, the requestId handle, the required prior state (activated symbols), the data-length constraint, and the non-obvious backend behavior that a 3xATR fallback take-profit is force-applied when no TP node exists. These are behavioral facts an agent cannot infer from the schema alone.

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 warning, the action, and the polling handoff before any parameter detail, and the prerequisite list is numbered for scanability. It is long, and the final sentence re-explains disableTakeProfit already covered by the schema, so there is some redundancy, but the length is defensible for a 12-parameter async tool.

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 annotations and no output schema, the description supplies what is otherwise missing: the return value shape (requestId), the polling workflow, prerequisites, and a failure-diagnosis path. Nothing an agent needs in order to invoke it correctly or interpret a 0-trade result is absent.

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 earns above that by explaining cross-parameter interaction the schema documents only in isolation (portfolioMode must be paired with maxConcurrentTrades; pyramiding concentration is unbounded unless maxPositionsPerSymbol is set). It adds real meaning about how the knobs compose rather than restating individual field descriptions.

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+resource ('Run a strategy backtest') plus an explicit async marker and return contract ('Returns requestId'), then names the follow-up tool dwlf_get_backtest_results. An agent can immediately tell this apart from the results-polling sibling.

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 explicit preconditions (symbols must be activated via dwlf_activate_strategy_symbols, 200+ daily candles / startDate 10+ months before endDate) and a concrete troubleshooting branch for the 0-trade outcome. It also states exactly when to set the optional knobs (portfolioMode with maxConcurrentTrades, allowSymbolPyramiding with maxPositionsPerSymbol, disableTakeProfit for exit-signal-only strategies), which is when-to-use guidance at parameter granularity.

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

Deploy Server

Other Tools