Skip to main content
Glama

Start a backtest loop

quant_start_backtest_loop
DestructiveIdempotent

Starts the backtest loop of a plan the member approved, by the plan_id quant_plan_backtest_loop returned, and returns its loop id. A backtest loop is an autonomous run in which Quant, our coding agent, writes and backtests Pine Script® strategy versions until enough of them meet the plan's criteria. Call it only after you showed the member that plan and they said yes in their own words; never start one on their behalf. Once started it runs on LuxAlgo's servers, for up to the plan's time limit, whether or not this chat stays open, and every attempt it makes uses the member's Quant usage until it ends or quant_stop_backtest_loop stops it. A plan starts at most one loop: starting it again returns the loop it already started. It returns the loop id, not strategies: follow it with quant_get_backtest_loop_info. To read what a loop found, call quant_get_backtest_loop_info for its strategies' ids (best first) and quant_get_backtest_loop_strategy for one strategy's code and backtests. Backtest loops run on the Ultimate and Ultra plans; the LuxAlgo app decides. 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": {
      "plan_id": "<plan_id>",
      "context": "<context>"
    },
    "name": "quant_start_backtest_loop"
  }
}

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."
plan_idYesThe plan_id quant_plan_backtest_loop returned.

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?

Goes well beyond the annotations: it discloses that the loop runs on LuxAlgo's servers up to the plan's time limit regardless of whether the chat stays open, that every attempt consumes the member's Quant usage until it ends or is stopped, and that a plan starts at most one loop so re-calling returns the existing loop id. This adds operational, cost, and idempotency context that the hints alone do not convey.

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-loads the action and then layers definition, preconditions, runtime/cost behavior, idempotency, and follow-ups in a logical order. It is dense but nearly every sentence carries decision-relevant information; the only minor redundancy is stating twice that reading results requires quant_get_backtest_loop_info.

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?

For an autonomous, usage-consuming, destructive(-flagged) mutation with no output schema, the description covers when to call, prerequisites, lifecycle/runtime, billing impact, idempotency, plan eligibility, auth, and how to retrieve results. Nothing an agent needs to invoke it safely is missing.

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%, so both parameters are already documented, including the source of plan_id and the analytics-only context string. The description reinforces that plan_id must be the value quant_plan_backtest_loop returned and clarifies the return value is a loop id rather than strategies, but adds no new syntax or constraints. Baseline 3 applies when the schema does the heavy lifting.

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 ('Starts the backtest loop of a plan') and immediately defines what a backtest loop is: an autonomous run where the coding agent writes and backtests Pine Script versions until the plan's criteria are met. It distinguishes itself from quant_plan_backtest_loop (which returns the plan_id), quant_get_backtest_loop_info (which reads results), and quant_stop_backtest_loop.

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 ('only after you showed the member that plan and they said yes in their own words; never start one on their behalf') plus the required upstream dependency (plan_id from quant_plan_backtest_loop) and the required follow-up (quant_get_backtest_loop_info, then quant_get_backtest_loop_strategy). Eligibility limits (Ultimate/Ultra, decided by the LuxAlgo app) and OAuth sign-in are also called out.

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.