Skip to main content
Glama

Get a strategy a backtest loop found

quant_get_backtest_loop_strategy
Read-only

One strategy of one of the member's backtest loops, by its id from quant_get_backtest_loop_info (best_strategy_id, or an id in strategies): whether it meets every criterion, what it does and how it trades in Quant's words, its Pine Script® source as it goes on a chart, and each market's backtest on the data it was developed on (in_sample) and on the data held out from it (out_of_sample): the verdict, every criterion against its threshold, the metrics (net profit, profit factor, trades, win rate, drawdown and the rest, by their plan names) and the run's statistics (dates, bars, Sharpe, Sortino, CAGR, run-up, buy and hold). For "what was the best strategy of my latest loop?", call quant_list_backtest_loops (newest first), then quant_get_backtest_loop_info, then this with its best_strategy_id. Quote the numbers as returned, name whether each is in sample or held out, and never round a failing strategy up to a passing one. It returns no trade list and no equity curve. The member puts a strategy on a chart, compares them and resumes a loop in Vela, in the loop's Loop Report (report_url). It reads only; it uses no Quant usage. Backtests are history under the plan's assumptions, never a prediction or trading advice. Requires signing in with a LuxAlgo account (OAuth).

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": {
      "strategy_id": "<strategy_id>",
      "context": "<context>"
    },
    "name": "quant_get_backtest_loop_strategy"
  }
}

Input Schema

NameRequiredDescriptionDefault
contextYesExplain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as "a user", "the customer", or "an account". Example: "Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution."
strategy_idYesThe strategy's id, from quant_get_backtest_loop_info: best_strategy_id, or an id in strategies.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/openWorld=false/destructive=false, yet the description still adds real behavior: it consumes no Quant usage, requires OAuth sign-in with a LuxAlgo account, returns no trade list and no equity curve, and backtests reflect plan assumptions rather than predictions. Those are exactly the constraints an agent needs before calling and before characterizing results.

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 identity of the resource and free of filler, and each subsequent sentence adds a distinct fact (output exclusions, workflow chain, report_url destination, usage cost, OAuth requirement). The opening is a single long run-on sentence with nested parentheticals that is harder to parse than a short bulleted breakdown would be, which keeps it from a 5.

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?

No output schema exists, so the description must carry the return shape — and it does, naming the verdict, per-criterion thresholds, metrics by plan name, and run statistics (dates, bars, Sharpe, Sortino, CAGR, run-up, buy and hold), plus what it deliberately omits. It also names where the member acts on the result (Vela, Loop Report via report_url), which is complete for a read-only detail tool.

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 100% and the schema already explains that strategy_id comes from quant_get_backtest_loop_info's best_strategy_id or an entry in strategies, so the description largely restates it. The context parameter is left entirely to the schema, which is acceptable given the schema documents it thoroughly, but no additional parameter meaning is contributed.

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 concrete verb and resource — one strategy belonging to one of the member's backtest loops, identified by an id — and enumerates what comes back (criterion verdict, Quant's description, Pine Script source, in-sample and out-of-sample backtests). That scope is clearly distinguishable from quant_get_backtest_loop_info, which returns the loop-level view and supplies the id.

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 routing rule for the common question 'what was the best strategy of my latest loop?': quant_list_backtest_loops (newest first), then quant_get_backtest_loop_info, then this tool with its best_strategy_id. It also states a usage constraint (quote numbers as returned, label in-sample vs held-out, never round a failing strategy up to a passing one), which is guidance an agent could not infer.

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.