Skip to main content
Glama

Sweep parameters, honestly

optimize_strategy

Search a strategy's declared params for the best combination, then report how much of that result is explained by the search itself. Searches on the first 60% of the window, chooses on the next 20%, and confirms on the last 20%, which it never looked at; rejects candidates that barely traded; and discounts the winning score by the number of attempts. Frequently concludes that the winner is not worth trading — that is the tool working, not failing. Uses 20 backtests from the quota, whatever its size.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
specYesThe strategy spec object — see get_strategy_spec_rules
minTradesNoCandidates with fewer training trades cannot win. Lowering it invites noise.
objectiveNoWhat to maximise. net_pnl rewards whichever run risked the most.sharpe
pointsPerParamNo
maxCombinationsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Discloses substantial behavior beyond the annotations: a 60/20/20 walk-forward split with an untouched holdout, low-trade candidate rejection, score discounting by number of attempts, and a fixed cost of 20 backtests from the quota. It even pre-frames the common 'winner is worthless' outcome. This is exactly the kind of caveat an agent needs, and nothing contradicts the readOnlyHint=false / destructiveHint=false annotations.

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

Conciseness5/5

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

Four dense sentences, all load-bearing, with the core action front-loaded and the methodology, cost, and expected-outcome caveat following in priority order. No filler or restatement of the title.

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 no output schema, the description carries the return-value burden; it explains the report's purpose (how much of the result the search explains) but not the concrete shape of the response (winner params, scores, rejection counts). For a 5-param sweep tool with search cost, the behavioral picture is otherwise complete.

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 60% (pointsPerParam and maxCombinations have constraints but no descriptions). The description partially compensates by explaining that scores are 'discounted by the number of attempts' and that it 'uses 20 backtests from the quota', giving the undocumented search-size params practical meaning. It also reinforces minTrades via 'rejects candidates that barely traded'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: 'Search a strategy's declared params for the best combination' plus a distinctive second function ('report how much of that result is explained by the search itself'). The scoping to a strategy's declared params implicitly separates it from optimize_portfolio, but no sibling is named explicitly.

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

Usage Guidelines3/5

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

Usage is implied through methodology rather than stated conditions: an agent infers this is for parameter sweeps on an existing strategy. It never names alternatives like optimize_portfolio, propose_optimization_plan, or plain run_backtest, nor says when not to use it. The note that a 'not worth trading' conclusion 'is the tool working, not failing' is useful expectation-setting but not routing guidance.

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