Skip to main content
Glama

find_sweep_runs

Read-onlyIdempotent

Runs from one sweep, or from every sweep this person has, filtered and sorted by the engine. LEAVE experiment_id OUT to search them all, which is how a person asking whether they have already found something like this gets an answer without spending a new search on a question that already has one. A SWEEP HAS NO WINNER: which run matters depends entirely on what was being asked, so you choose sort_by for the question in front of you -- return, risk-adjusted return, drawdown, trade count -- and say which one you sorted by whenever you report an order. Never call the top row 'the best strategy'; it is the top row by the measure you picked. Filter before you sort: a run with a handful of trades has metrics that mean nothing, so min_trades is usually the first thing to set. Every numeric filter has BOTH bounds, so a band is one question: a delta against the benchmark between 3 and 8 is min and max together, not a page fetched and thinned by hand. Readable while the sweep is still running. At most 50 runs per call (default 20); pass offset to read on.

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": {
      "sort_by": "<sort_by>"
    },
    "name": "find_sweep_runs"
  }
}

Input Schema

NameRequiredDescriptionDefault
assetNoAsset symbol, e.g. BTC or ETH.
limitNoMaximum results.
orderNodesc for best-first on that metric, asc for worst-first.desc
trendNoOnly runs from windows of this trend character, e.g. clean or choppy; several comma-separated, any of them counts.
offsetNoPagination offset in the result units documented by the tool; zero starts the first page.
max_irrNoOnly runs at or below this annualised IRR.
min_irrNoOnly runs at or above this annualised IRR.
sort_byYesThe metric to order by, e.g. sharpe_ratio, sortino_ratio, irr_annualized, total_return, avg_daily_return, num_days, simple_annualized_return, avg_closed_trade_return, closed_trade_count, max_drawdown, total_trades. Required, because the choice IS the question being asked.
coveringNoOnly runs over windows covering this single date, as YYYY-MM-DD. A different question from a span.
max_daysNoMaximum recorded backtest days, inclusive.
min_daysNoMinimum recorded backtest days, inclusive. An explicit value overrides the conditional IRR duration default, including zero.
run_indexNoWhich run, as find_sweep_runs reported it.
atr_periodNoOnly runs that used this ATR period. Needs experiment_id.
generationNoOnly runs from this engine generation, so runs made under different engine behaviour are not compared as though alike.
max_returnNoOnly runs at or below this total return.
max_sharpeNoOnly runs at or below this Sharpe ratio.
max_tradesNoOnly runs at or below this trade count. Pairs with min_trades to ask for a band rather than a floor.
min_returnNoOnly runs at or above this total return.
min_sharpeNoOnly runs at or above this Sharpe ratio.
min_tradesNoDrop runs with fewer trades than this. Metrics from a handful of trades are noise.
run_statusNoOnly runs with this outcome, e.g. no_trades for the ones that never opened a position.
volatilityNoOnly runs from windows of this volatility band, e.g. low; several comma-separated, any of them counts.
candle_sizeNoDuration of one candle, e.g. 1h or 1d.
covering_toNoOnly runs whose window overlaps up to this date.
max_win_rateNoOnly runs at or below this win rate.
min_win_rateNoOnly runs at or above this win rate.
trigger_nameNoOnly runs whose entry trigger is this signal.
cooldown_barsNoOnly runs that used this cooldown. Needs experiment_id.
covering_fromNoOnly runs whose window OVERLAPS this date onwards. A run is relevant to 2024 if any of it happened in 2024.
experiment_idNoThe sweep, as create_sweep returned it.
reward_factorNoOnly runs that used this reward-to-risk setting. Execution filters need experiment_id; the cross-sweep surface does not serve them.
beats_benchmarksNoOnly runs that beat all three benchmarks over the same
market_directionNoOnly runs from windows of this market character, e.g. bear or mega_bull. Several are one comma-separated string, e.g. "bull,super_bull", and a run matching any of them counts. What a run did in one kind of market says little about another.
regime_compositeNoOnly runs from windows with this full regime label, e.g. mega_bull_high_clean, when the three parts together matter; several comma-separated, any of them counts. Across different regime filters every one must hold.
regime_directionNoThe direction band from get_market_regime, e.g. bear. The signal searches filter by it and find_sweep_runs marks each row's regime_fit with it; save_strategy and update_strategy read the current band themselves, so their check runs without it.
min_closed_tradesNoMinimum number of closed trades, inclusive.
max_delta_vs_assetNoOnly runs beating their own asset by at most this much.
max_risk_per_tradeNoOnly runs that risked this fraction per trade. Needs experiment_id.
min_delta_vs_assetNoOnly runs beating buy-and-hold on their own asset by at least this much.
max_avg_daily_returnNoMaximum mean daily return in percent, inclusive.
min_avg_daily_returnNoMinimum mean daily return in percent, inclusive.
max_delta_vs_benchmarkNoOnly runs beating their benchmark by at most this much, so "between 3 and 8" is one question rather than a page fetched and thrown away.
min_delta_vs_benchmarkNoOnly runs that beat their benchmark by at least this much. A return in a rising market is not skill.
beats_crypto_benchmarksNoOnly runs that beat the crypto benchmarks rather than only their own asset.
use_irr_duration_defaultNoWhen true, Oracle uses a 182-day minimum only if min_irr is supplied and min_days is omitted. To clear that default, pass false and omit min_days. Read effective_filters.
max_avg_closed_trade_returnNoMaximum mean net return per closed trade.
min_avg_closed_trade_returnNoMinimum mean net return per closed trade in percent of absolute entry notional. Unknown histories stay null.
max_simple_annualized_returnNoMaximum simple annualized return percent.
min_simple_annualized_returnNoMinimum total return / recorded days * 365, in percent; simple annualization, not IRR or compounding.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • addedInput schema / properties / max_avg_closed_trade_return
      Added value: +{
      +  "description": "Maximum mean net return per closed trade.",
      +  "type": "number"
      +}
    • addedInput schema / properties / max_avg_daily_return
      Added value: +{
      +  "description": "Maximum mean daily return in percent, inclusive.",
      +  "type": "number"
      +}
    • addedInput schema / properties / max_days
      Added value: +{
      +  "description": "Maximum recorded backtest days, inclusive.",
      +  "type": "integer"
      +}
    • addedInput schema / properties / max_simple_annualized_return
      Added value: +{
      +  "description": "Maximum simple annualized return percent.",
      +  "type": "number"
      +}
    • addedInput schema / properties / min_avg_closed_trade_return
      Added value: +{
      +  "description": "Minimum mean net return per closed trade in percent of absolute entry notional. Unknown histories stay null.",
      +  "type": "number"
      +}
    • addedInput schema / properties / min_avg_daily_return
      Added value: +{
      +  "description": "Minimum mean daily return in percent, inclusive.",
      +  "type": "number"
      +}
    • addedInput schema / properties / min_closed_trades
      Added value: +{
      +  "description": "Minimum number of closed trades, inclusive.",
      +  "type": "integer"
      +}
    • addedInput schema / properties / min_days
      Added value: +{
      +  "description": "Minimum recorded backtest days, inclusive. An explicit value overrides the conditional IRR duration default, including zero.",
      +  "type": "integer"
      +}
    • addedInput schema / properties / min_simple_annualized_return
      Added value: +{
      +  "description": "Minimum total return / recorded days * 365, in percent; simple annualization, not IRR or compounding.",
      +  "type": "number"
      +}
    • changedInput schema / properties / sort_by / description
      Previous value: -"The metric to order by, e.g. sharpe_ratio, sortino_ratio, irr_annualized, total_return, max_drawdown, total_trades. Required, because the choice IS the question being asked."New value: +"The metric to order by, e.g. sharpe_ratio, sortino_ratio, irr_annualized, total_return, avg_daily_return, num_days, simple_annualized_return, avg_closed_trade_return, closed_trade_count, max_drawdown, total_trades. Required, because the choice IS the question being asked."
    • addedInput schema / properties / use_irr_duration_default
      Added value: +{
      +  "default": true,
      +  "description": "When true, Oracle uses a 182-day minimum only if min_irr is supplied and min_days is omitted. To clear that default, pass false and omit min_days. Read effective_filters.",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations cover read-only/idempotent, but the description adds traits they cannot: results are readable while the sweep is still running, the cap is 50 per call (default 20) with offset paging, and execution filters are only served when experiment_id is supplied. The 'a sweep has no winner' framing also sets how results should be interpreted.

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 sweep-vs-all distinction and generally well-organized around filter-then-sort-then-paginate. Some passages are rhetorically padded (the 'person asking whether they have already found something like this' sentence) and could be tightened, but length is defensible for a 49-parameter tool.

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?

Covers filtering, sorting, pagination, running-state, and the experiment_id prerequisite, which is a lot for a complex tool with no output schema. What a returned row actually contains is only implied (run_index, regime_fit), so an agent still has to discover the result shape by calling it.

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 already 100%, so the baseline is 3; the description earns more by explaining that every numeric filter has both bounds so a band is one call, why min_trades matters, how covering_from differs from a span, and why sort_by is required. It stops short of covering the 49 params exhaustively, which the schema already does.

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 with scope: 'Runs from one sweep, or from every sweep this person has, filtered and sorted by the engine.' It also distinguishes the sweep-wide case from the cross-sweep case (leave experiment_id out) and implicitly from single-run retrieval, so an agent can tell what it returns.

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 when-to guidance (omit experiment_id to search all sweeps), an ordering discipline (filter before you sort, set min_trades first), a band-vs-floor rule, and a reporting rule (name the sort metric, never call the top row 'the best strategy'). It also flags that some execution filters require experiment_id, which prevents a wrong call.

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.