Skip to main content
Glama

Submit Backtest

submit_backtest

Submits a strategy for backtesting against historical OHLCV data. Returns immediately with an id and status — call get_backtest_result to fetch the outcome once it finishes. Testing the same strategy against many assets? Use submit_backtest_batch instead — one call per asset here adds up fast. Optionally accepts confirmationSources to only count a candidate Entry/Exit as a real trade once corroborated by a submit_confirmation_source result (multi-timeframe or cross-asset confirmation) — see the confirmationSources argument and submit_confirmation_source's own description.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetPairNoe.g. "BTC-USDC".
finalDateNoISO date string, e.g. "2025-06-01".
initialDateNoISO date string, e.g. "2025-01-01".
backtestApiKeyNoYour EmidLabs backtest API key (created in the Console). Not needed if this connector was added with a static 'x-api-key' header.
backtestBaseUrlNoDefaults to the public production API. Override only for self-hosted/staging use.
confirmationSourcesNoOptional. Each entry names a submit_confirmation_source result (same account only, must already be Completed) that every candidate Entry/Exit must be corroborated by before it's simulated as a trade — an unconfirmed candidate is dropped before trade simulation, never appears in get_backtest_trades or affects PnlR/WinRate/etc. See ConfirmedSignalsCount/UnconfirmedSignalsCount on get_backtest_result. A sourceId that doesn't exist, isn't Completed, or belongs to another account fails this submission immediately (unlike live, this is synchronous/batch — letting it through would produce a confusing zero-trade result with no explanation).
strategySnapshotJsonNoThe Strategy DSL object — every field below documents its own exact shape, this is just the execution model that ties them together. Entry fills at the close of the candle where decision.entry turns true (no lookahead). A position closes on the first of these to happen, checked in this order: stop-loss hit, take-profit hit, decision.exit turning true (a same-candle stop/take-profit always wins over exit). Multiple positions can be open at once by default — cap with configuration.maxOpenPositions. Results are measured in R-units (risk multiples); expectancyR (average R per trade) is the metric to optimize, not raw win rate or trade count.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNo
statusNo

TDQS

A4.7/5.0
Behavior4/5

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

The description discloses the async behavior — returns id/status immediately, outcome fetched later via get_backtest_result — which annotations do not convey. It also surfaces the confirmationSources filtering behavior. It could go further on side effects or duplicate submissions, but the idempotentHint=false already signals that, and no contradiction exists.

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?

Three purposeful sentences: the first states the core action and async lifecycle, the second gives the batch alternative, the third explains the confirmation feature. It is front-loaded with the most important information and contains no filler.

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?

Given the output schema exists, return values need no explanation in the description. The complex strategySnapshotJson shape is fully documented in the schema, and the description supplies the missing operational context: async submission, follow-up result call, batch alternative, and confirmation-source behavior. The tool is adequately specified for an agent to invoke 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 schema already documents every parameter. The description still adds meaning by explaining the high-level semantics of confirmationSources (only count corroborated trades, multi-timeframe/cross-asset confirmation) and by highlighting the cost of one-call-per-asset, which helps the agent reason about parameter usage beyond syntax.

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 description opens with a specific verb and resource: 'Submits a strategy for backtesting against historical OHLCV data.' It also distinguishes itself from get_backtest_result (fetch outcome) and submit_backtest_batch (batch variant), so an agent can tell what this tool does and what it is not.

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?

Explicitly routes to submit_backtest_batch when testing the same strategy across many assets, and to get_backtest_result after submission. It also frames confirmationSources as optional and points the agent to submit_confirmation_source's description, giving clear when-to-use context.

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.6/5.0
Disambiguation5/5

Each tool targets a distinct resource/action: single backtests, batch backtests, trades, confirmation sources, signals, and asset discovery. The batch getter is explicitly differentiated from the single-result getter, and confirmation sources are clearly separated from tradable backtests.

Naming Consistency5/5

Tool names follow a clear verb_noun pattern: submit_backtest, submit_backtest_batch, get_backtest_result, get_backtest_trades, get_confirmation_source, list_available_assets. Modifiers like batch, trades, and signals are consistent and make each tool's role predictable.

Tool Count5/5

Nine tools is well-scoped for a backtesting server: three submission endpoints, four result-fetching endpoints, signal retrieval, and asset discovery. There is no apparent redundancy or tool bloat.

Completeness5/5

The surface covers the full backtest lifecycle: submitting single and batch backtests, retrieving aggregate results, drilling into trades, creating and reading confirmation sources, and discovering available assets. No critical operation appears missing for the stated domain.

Resources