Skip to main content
Glama

Run a backtest

run_backtest
Idempotent

Run a point-in-time backtest and return its run_id, metrics, sources and honesty checks.

    The run may only see data stamped on or before `as_of` — that is enforced structurally, not
    by convention. Results arrive with the data `query_ids` behind them and an anti-overfitting
    verdict (out-of-sample, deflated Sharpe, multiple-comparison, crash stress); a run that
    fails the gate is returned REJECTED with reasons rather than hidden.

    Args:
        strategy_id: a registered strategy, e.g. 'buy_and_hold' or 'cross_sectional_momentum'.
        start / end: the測試期間 (YYYY-MM-DD). `end` must not be after `as_of`.
        as_of: the knowledge cutoff. REQUIRED — there is no "today" default.
        tickers: required when universe_kind='explicit'; ignored for 'point_in_time'.
        universe_kind: 'point_in_time' (survivorship-safe, resolved from listing/delisting
            dates at each rebalance) or 'explicit' (a list you supplied).
        market: optional market filter for a point-in-time universe.
        rebalance: 'daily' | 'weekly' | 'monthly'.
        cost_bps: one-way transaction cost in basis points.
        params: strategy parameters, e.g. {'lookback_days': 60, 'top_k': 5}.

    This measures history. It is not advice and it places no orders.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endYes
as_ofYes
labelNo
startYes
marketNo
paramsNo
tickersNo
cost_bpsNo
rebalanceNomonthly
strategy_idYes
universe_kindNopoint_in_time

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
cagrNo
hintNo
as_ofNo
errorNo
periodNo
reasonNo
run_idNo
sharpeNo
statusNo
blockedNo
acceptedNo
turnoverNo
warningsNo
citationsNo
query_idsNo
gate_passedNo
max_drawdownNo
anti_overfittingNo
known_strategiesNo
rejection_reasonsNo
survivorship_safeNo
not_investment_adviceNo

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the annotations, it reveals that as_of is structurally enforced so the run cannot peek ahead, that failed runs are returned REJECTED with reasons rather than hidden, that results include query_ids and anti-overfitting checks, and that it places no orders. These are concrete behavioral traits not derivable from readOnly, idempotent, or destructive hints. No contradiction.

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 structure is front-loaded: purpose, behavior, then a compact Args list, then a short disclaimer. The Args block earns its length for an 11-parameter tool. Minor blemish: 'the測試期間' mixes languages and the first paragraph slightly overlaps with the 'Results arrive...' sentence, so it is not a perfect 5.

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 a complex 11-parameter tool, the description is essentially complete: all meaningful parameters (except label) are covered with semantics and constraints, the no-default as_of requirement is explicit, rejection behavior is described, and the output schema covers return detail. It leaves almost nothing an agent needs in order to call the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the Args block compensates fully: it gives examples for strategy_id, date range meaning and the end <= as_of constraint, required no-default status for as_of, conditional tickers behavior, universe_kind options, rebalance values, cost_bps unit, and params format. Only label is not explained, a low-stakes parameter.

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?

The description opens with a specific action (run) on a specific resource (a point-in-time backtest) and names the output (run_id, metrics, sources, honesty checks). It is easy to tell apart from research/recipe tools, but it does not explicitly contrast with sibling tools like get_backtest or replay_backtest, so it stops short of full 5.

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?

The description implies the use case — run backtests to measure historical strategy performance — and says 'This measures history.' It also gives conditional parameter guidance (tickers required for explicit universe) and invariants like end <= as_of. However, it never states when to prefer this tool over siblings like run_research, run_recipe, or replay_backtest, or when not to use it.

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.

TDQS

A4/5.0
Disambiguation4/5

The tools are largely distinct: querying, searching, backtesting, risk reads, alerts, memory, and audit functions each have clear homes. A few adjacent pairs (risk_read vs risk_assess, company_health_check vs positioning_read) could be confused, but the descriptions draw explicit boundaries.

Naming Consistency3/5

There are strong consistent clusters like list_*, get_*, run_*, and memory_*, but the *_read suffix alternates with noun-first names like company_health_check, and bare-verb tools like ask, calendar, chart, and screen break the pattern. The naming is readable but not uniform.

Tool Count2/5

Forty tools is well past the 25+ threshold and makes the surface heavy for an agent to navigate, even though the breadth reflects a genuinely wide platform. Several clusters could plausibly be consolidated without losing capability.

Completeness4/5

The tool surface covers the main lifecycle well: discovery, point-in-time querying, filings search and full text, backtesting, research, risk assessment, alerts, memory, approvals, and provenance verification. Minor gaps exist—no strategy management tools, no memory deletion, no bulk export—but agents can work around them.

Resources