Skip to main content
Glama

Generate Strategy Code (no training)

generate_strategy

Generate Python strategy code only: nothing is trained or deployed.

Returns the generated code for the user to read or edit; each call is billed
from the account's credits.

Args:
  features: Plain-English description of features (e.g. "RSI 14, Bollinger Bands").
  signals: Plain-English description of signal logic (e.g. "Buy when RSI < 30").
  model: ML model name (default Random Forest), or "rule-based" for fixed rules with no ML (#3258: the
    code then holds model_type RuleBased and a rules list; train_strategy trains it).
  risk: Plain-English risk rules (e.g. "0.5% stop loss").
  description: Optional one-line summary; the generator weighs it as the
    main request.
  symbol: Market the code should target. One of: EURUSD, USDJPY,
    GBPUSD, USDCHF, USDCAD, AUDUSD, NZDUSD, XAUUSD, XAGUSD, BTCUSD. Default EURUSD.
  timeframe: Candle granularity. One of: 1min, 5min, 15min, 1h. Default 15min.
  claude_model: "sonnet" (default), "haiku" (faster, about a third of the credits) or "sonnet-haiku"
    (Sonnet writes the spec, Haiku the code). Any case.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "generate_strategy"
  }
}

Input Schema

NameRequiredDescriptionDefault
riskNoRisk rules in plain English, e.g. "0.5% stop loss".
modelNoThe model the code uses: an ML model name such as Random Forest (default), XGBoost or LightGBM, or rule-based for fixed rules with no ML.Random Forest
symbolNoMarket: EURUSD, USDJPY, GBPUSD, USDCHF, USDCAD, AUDUSD, NZDUSD, XAUUSD, XAGUSD or BTCUSD. Default EURUSD.
signalsNoThe signal logic in plain English, e.g. "Buy when RSI < 30".
featuresNoThe features in plain English, e.g. "RSI 14, Bollinger Bands".
timeframeNoBar size: 1min, 5min, 15min or 1h. Default 15min.
descriptionNoOptional one-line summary of the whole request; the generator weighs it as the main request.
claude_modelNoWhich Claude model writes the code: sonnet (default), sonnet-haiku (Sonnet writes the spec, Haiku the code) or haiku (faster, about a third of the credits). Any case.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • addedInput schema / properties / claude_model / description
      Added value: +"Which Claude model writes the code: sonnet (default), sonnet-haiku (Sonnet writes the spec, Haiku the code) or haiku (faster, about a third of the credits). Any case."
    • addedInput schema / properties / description / description
      Added value: +"Optional one-line summary of the whole request; the generator weighs it as the main request."
    • addedInput schema / properties / features / description
      Added value: +"The features in plain English, e.g. \"RSI 14, Bollinger Bands\"."
    • addedInput schema / properties / model / description
      Added value: +"The model the code uses: an ML model name such as Random Forest (default), XGBoost or LightGBM, or rule-based for fixed rules with no ML."
    • addedInput schema / properties / risk / description
      Added value: +"Risk rules in plain English, e.g. \"0.5% stop loss\"."
    • addedInput schema / properties / signals / description
      Added value: +"The signal logic in plain English, e.g. \"Buy when RSI < 30\"."
    • addedInput schema / properties / symbol / description
      Added value: +"Market: EURUSD, USDJPY, GBPUSD, USDCHF, USDCAD, AUDUSD, NZDUSD, XAUUSD, XAGUSD or BTCUSD. Default EURUSD."
    • addedInput schema / properties / timeframe / description
      Added value: +"Bar size: 1min, 5min, 15min or 1h. Default 15min."
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations mark this as non-read-only, open-world, non-idempotent and non-destructive, and the description adds the crucial fact that each call is billed from the account's credits, which explains the non-idempotency and is the main risk an agent must weigh. It also clarifies the output is code for a human to read or edit rather than something executed, though it doesn't mention rate limits or failure modes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The behavioral framing is correctly front-loaded in the first two sentences, but the Args block largely restates the schema's own parameter descriptions near-verbatim for all eight parameters, which is padding given 100% schema coverage. The genuinely novel details (rule-based internals, credit costs) are buried inside that repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return values need no explanation, and the definition covers the two things an agent most needs: no training happens here and every call costs credits. The rule-based caveat and model-cost options round it out; only edge cases such as how credits are counted or what happens on generation failure are 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, but the description adds real meaning beyond it: 'rule-based' produces model_type RuleBased plus a rules list that train_strategy later trains, and claude_model documents the cost/speed tradeoffs (haiku about a third of the credits, sonnet-haiku splits spec and code). It also states that description is weighted as the main request, which the schema 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?

States a specific verb and resource ('Generate Python strategy code') and immediately bounds the scope with 'nothing is trained or deployed', which cleanly separates it from train_strategy. An agent can distinguish it from get_strategy_code and train_strategy without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The opening line establishes the condition for use (you want code only, not training or deployment) and the model parameter explanation points at train_strategy as the follow-up step for rule-based output. It never states an explicit exclusion or alternative at the top level, but the surrounding context is clear.

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.

Resources