Skip to main content
Glama

Plan a backtest loop

quant_plan_backtest_loop

Turns a prompt into the plan of a backtest loop and returns it with a plan_id; it starts nothing. 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. Quant writes the plan: the markets and timeframes, the tested date range and how much of it is held out, costs, order size, how many strategies to find, a time limit, and the measurable criteria a strategy must meet on every market, with its own estimate of the odds. Say in the prompt what the member said about markets, timeframe, direction, the metrics and thresholds that count as success, the history to test on and the time to spend; ask them first about anything that matters and is open, because the plan cannot ask back. The planning call uses a little of the member's Quant usage. Show the member the plan in plain words and wait for their yes before calling quant_start_backtest_loop with the plan_id. Backtests are history under stated 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": {
      "prompt": "<prompt>",
      "context": "<context>"
    },
    "name": "quant_plan_backtest_loop"
  }
}

Input Schema

NameRequiredDescriptionDefault
promptYesWhat to search for, in the member's terms, e.g. "a long-only trend strategy on BTCUSDT 1 hour bars over the last 2 years, profit factor at least 1.5, max drawdown under 15%, at least 60 trades, 30 minutes".
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."

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=false), the description discloses that the call consumes a little of the member's Quant usage, requires OAuth sign-in with a LuxAlgo account, has no interactive follow-up ("cannot ask back"), and returns a plan_id without starting anything. This is strong behavioral disclosure; the only missing piece is whether re-planning the same prompt is idempotent or whether plans expire, which the non-idempotent annotation leaves open.

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?

The key fact (planning only, nothing starts) is front-loaded, and the paragraph flows from definition to prompt content to cost/approval. It is long and carries a couple of sentences that are closer to agent-instruction policy than tool semantics (the plain-words/approval ritual, the disclaimer), but none are redundant.

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 correctly states the return (a plan plus plan_id). It covers the prerequisites (OAuth), the side cost (Quant usage), the non-interactive nature of the call, the follow-up step, and the interpretive limit of results, which is everything an agent needs to call it correctly.

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, and the description earns above that by enumerating exactly what the prompt must contain (markets, timeframes, tested and held-out date range, costs, order size, strategy count, time limit, measurable criteria, odds). It also reframes prompt content in terms of what the member said, which is meaning the schema's single example does not convey.

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?

The first sentence gives a concrete verb and resource ("Turns a prompt into the plan of a backtest loop") and immediately disambiguates scope with "it starts nothing," which separates it from the sibling quant_start_backtest_loop. The second sentence defines what a backtest loop actually is, so the agent does not have to infer the domain concept.

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?

It explicitly prescribes the workflow: gather markets, timeframe, direction, metrics, thresholds, history and time from the member, ask about open items first because "the plan cannot ask back," then show the plan in plain words and wait for approval before calling quant_start_backtest_loop with the plan_id. The handoff to a named sibling and the condition that triggers it are both stated.

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.