Skip to main content
Glama

Submit Backtest Batch

submit_backtest_batch

Submits ONE strategy against MANY asset pairs in a single call — the same backtest you'd get from calling submit_backtest once per asset, without needing dozens of round trips. Returns immediately with a batchId (pass it to get_backtest_batch_results to fetch every asset's outcome, paginated) plus the per-asset id/status assigned right away. Best-effort: one bad asset pair (unknown, or its date range outside coverage) shows up with an error in that item only — every other asset in the batch is unaffected. Optionally accepts confirmationSources, applied identically to every asset in the batch — see submit_backtest's own confirmationSources argument for the full semantics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
finalDateNoISO date string, e.g. "2025-06-01".
assetPairsNoe.g. ["BTC-USDC", "ETH-USDC", "SOL-USDC"]. Every asset gets the exact same strategySnapshotJson and date range.
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. A JSON-encoded STRING (not a native array/object — pass it exactly like a quoted string value), containing the same shape as submit_backtest's own confirmationSources: [{"sourceId":"<a submit_confirmation_source id>","signalType":"entry","validityWindow":{"count":1}}]. Applied identically to every asset pair in this batch (one shared gate, not one per asset). Passed as a raw JSON string rather than a native array because this tool already has one array parameter (assetPairs) — a second one crashes the MCP SDK's own parameter marshaller. A sourceId that doesn't exist, isn't Completed, or belongs to another account fails that item only (same best-effort semantics as an unknown asset pair), not the whole batch.
strategySnapshotJsonNoSame Strategy DSL object submit_backtest takes — see that tool's description for the full shape.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsNo
batchIdNoPass this to get_backtest_batch_results to fetch every item's status/result, paginated.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changed
    • addedInput schema / properties / strategySnapshotJson / properties / configuration / properties / timezone
      Added value: +{
      +  "description": "IANA timezone id (e.g. \"America/Sao_Paulo\") used to localize the DSL's hour()/minute()/dayOfWeek()/isWeekend() functions, for time-of-day or weekday gating conditions. Omit/null defaults to \"America/Sao_Paulo\".",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  2. Changed3 schema fields changed
    • changedInput schema / properties / confirmationSources / description
      Previous value: -"Optional. Same shape as submit_backtest's own confirmationSources — applied identically to every asset pair in this batch (one shared confirmationSources gate, not one per asset). A sourceId that doesn't exist, isn't Completed, or belongs to another account fails that item only (same best-effort semantics as an unknown asset pair), not the whole batch."New value: +"Optional. A JSON-encoded STRING (not a native array/object — pass it exactly like a quoted string value), containing the same shape as submit_backtest's own confirmationSources: [{\"sourceId\":\"<a submit_confirmation_source id>\",\"signalType\":\"entry\",\"validityWindow\":{\"count\":1}}]. Applied identically to every asset pair in this batch (one shared gate, not one per asset). Passed as a raw JSON string rather than a native array because this tool already has one array parameter (assetPairs) — a second one crashes the MCP SDK's own parameter marshaller. A sourceId that doesn't exist, isn't Completed, or belongs to another account fails that item only (same best-effort semantics as an unknown asset pair), not the whole batch."
    • removedInput schema / properties / confirmationSources / items
      Removed value: -{
      -  "description": "One confirmation requirement: this backtest's own candidate Entry/Exit only counts as a trade once sourceId's own signal timeline is corroborated within validityWindow.",
      -  "properties": {
      -    "signalType": {
      -      "description": "\"entry\" or \"exit\" — which of the source's signal types counts as confirming. Defaults to \"entry\" when omitted.",
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "sourceId": {
      -      "description": "The id returned by submit_confirmation_source (same account only) whose signal timeline this backtest's candidates must be corroborated by.",
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "validityWindow": {
      -      "description": "An OBJECT, not a bare number — e.g. { \"count\": 5 }. Defaults to { \"count\": 1 } when omitted.",
      -      "properties": {
      -        "count": {
      -          "description": "Number of candles of the source's own timeframe. Defaults to 1 when omitted.",
      -          "type": "integer"
      -        }
      -      },
      -      "type": [
      -        "object",
      -        "null"
      -      ]
      -    }
      -  },
      -  "required": [
      -    "sourceId"
      -  ],
      -  "type": [
      -    "object",
      -    "null"
      -  ]
      -}
    • changedInput schema / properties / confirmationSources / type
      Previous value: -[
      -  "array",
      -  "null"
      -]New value: +[
      +  "string",
      +  "null"
      +]
  3. Changed1 schema field changed
    • changedInput schema / properties / confirmationSources / items / properties / validityWindow / description
      Previous value: -"How recent the source's own signal must be, expressed in candles of the SOURCE's own timeframe — not a fixed duration, so it scales automatically with whichever strategy is confirming."New value: +"An OBJECT, not a bare number — e.g. { \"count\": 5 }. Defaults to { \"count\": 1 } when omitted."
  4. Changed1 schema field changed
    • addedInput schema / properties / confirmationSources
      Added value: +{
      +  "default": null,
      +  "description": "Optional. Same shape as submit_backtest's own confirmationSources — applied identically to every asset pair in this batch (one shared confirmationSources gate, not one per asset). A sourceId that doesn't exist, isn't Completed, or belongs to another account fails that item only (same best-effort semantics as an unknown asset pair), not the whole batch.",
      +  "items": {
      +    "description": "One confirmation requirement: this backtest's own candidate Entry/Exit only counts as a trade once sourceId's own signal timeline is corroborated within validityWindow.",
      +    "properties": {
      +      "signalType": {
      +        "description": "\"entry\" or \"exit\" — which of the source's signal types counts as confirming. Defaults to \"entry\" when omitted.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "sourceId": {
      +        "description": "The id returned by submit_confirmation_source (same account only) whose signal timeline this backtest's candidates must be corroborated by.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "validityWindow": {
      +        "description": "How recent the source's own signal must be, expressed in candles of the SOURCE's own timeframe — not a fixed duration, so it scales automatically with whichever strategy is confirming.",
      +        "properties": {
      +          "count": {
      +            "description": "Number of candles of the source's own timeframe. Defaults to 1 when omitted.",
      +            "type": "integer"
      +          }
      +        },
      +        "type": [
      +          "object",
      +          "null"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "sourceId"
      +    ],
      +    "type": [
      +      "object",
      +      "null"
      +    ]
      +  },
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
  5. Changed1 schema field changed
    • changedInput schema / properties / strategySnapshotJson / properties / inputs / description
      Previous value: -"Named computed values, one JSON-string expression each, evaluated once per candle. Raw fields: close, open, high, low, volume. Built-in functions (case-sensitive, lowercase — no others exist, e.g. avg()/SMA() uppercase/close[N] bracket indexing are NOT supported): ema(series,period), sma(series,period), rsi(series,period), atr(period), adx(period), adxPlusDi(period), adxMinusDi(period), crossUp(a,b), crossDown(a,b), highest(series,n), lowest(series,n), change(series), volumeSma(period), volumeSpike(multiplier), body(), range(), upperWick(), lowerWick(), abs(x), min(a,b), max(a,b). Candlestick patterns (all no-arg, boolean, read only closed-candle OHLC, same in backtest and live): single-candle hammer(), shootingStar(), doji(), bullishMarubozu(), bearishMarubozu(), spinningTop(), dragonflyDoji(), gravestoneDoji(), longLeggedDoji(); two-candle bullishEngulfing(), bearishEngulfing(), piercingLine(), darkCloudCover(), bullishHarami(), bearishHarami(), haramiCross(), tweezerTop(), tweezerBottom(); three-plus-candle morningStar(), eveningStar(), threeWhiteSoldiers(), threeBlackCrows(), threeInsideUp(), threeInsideDown(), threeOutsideUp(), threeOutsideDown(), risingThreeMethods(), fallingThreeMethods(). Caveat: hammer()/shootingStar() are shape-only, no prior-trend check (same shape is Hammer in a downtrend but Hanging Man in an uptrend, and vice versa for shootingStar/Inverted Hammer) — pair with a trend/momentum condition rather than using the shape alone. An input may only reference inputs defined above it (no forward/circular references). Example: {\"emaFast\":\"ema(close, 9)\",\"emaSlow\":\"ema(close, 21)\"}"New value: +"Named computed values, one JSON-string expression each, evaluated once per candle. Raw fields: close, open, high, low, volume. Built-in functions (case-sensitive, lowercase — no others exist, e.g. avg()/SMA() uppercase/close[N] bracket indexing are NOT supported): ema(series,period), sma(series,period), rsi(series,period), atr(period), adx(period), adxPlusDi(period), adxMinusDi(period), crossUp(a,b), crossDown(a,b), highest(series,n), lowest(series,n), change(series), shift(series,n) [look-back only, NaN before enough history], any(boolSeries,n), all(boolSeries,n), count(boolSeries,n) [over the n candles before the current one], swingHigh(series,confirmBars), swingLow(series,confirmBars) [confirmed N-bar swing point, true confirmBars candles AFTER the actual peak/trough — never at the peak itself, so it can't repaint between backtest and live], body(), range(), upperWick(), lowerWick(), isBullish(), isBearish(), abs(x), min(a,b), max(a,b). There is no volumeSma()/volumeSpike() — volume is a plain series like close/open/high/low, so use sma(volume,period) and volume > sma(volume,period) * multiplier instead. Candlestick patterns (all no-arg, boolean, read only closed-candle OHLC, same in backtest and live): single-candle hammer(), shootingStar(), doji(), bullishMarubozu(), bearishMarubozu(), spinningTop(), dragonflyDoji(), gravestoneDoji(), longLeggedDoji(); two-candle bullishEngulfing(), bearishEngulfing(), piercingLine(), darkCloudCover(), bullishHarami(), bearishHarami(), haramiCross(), tweezerTop(), tweezerBottom(); three-plus-candle morningStar(), eveningStar(), threeWhiteSoldiers(), threeBlackCrows(), threeInsideUp(), threeInsideDown(), threeOutsideUp(), threeOutsideDown(), risingThreeMethods(), fallingThreeMethods(). Caveat: hammer()/shootingStar() are shape-only, no prior-trend check (same shape is Hammer in a downtrend but Hanging Man in an uptrend, and vice versa for shootingStar/Inverted Hammer) — pair with a trend/momentum condition rather than using the shape alone. An input may only reference inputs defined above it (no forward/circular references). Example: {\"emaFast\":\"ema(close, 9)\",\"emaSlow\":\"ema(close, 21)\"}"
  6. Changed1 schema field changed
    • changedInput schema / properties / strategySnapshotJson / properties / inputs / description
      Previous value: -"Named computed values, one JSON-string expression each, evaluated once per candle. Raw fields: close, open, high, low, volume. Built-in functions (case-sensitive, lowercase — no others exist, e.g. avg()/SMA() uppercase/close[N] bracket indexing are NOT supported): ema(series,period), sma(series,period), rsi(series,period), atr(period), adx(period), adxPlusDi(period), adxMinusDi(period), crossUp(a,b), crossDown(a,b), highest(series,n), lowest(series,n), change(series), volumeSma(period), volumeSpike(multiplier), body(), range(), upperWick(), lowerWick(), abs(x), min(a,b), max(a,b). An input may only reference inputs defined above it (no forward/circular references). Example: {\"emaFast\":\"ema(close, 9)\",\"emaSlow\":\"ema(close, 21)\"}"New value: +"Named computed values, one JSON-string expression each, evaluated once per candle. Raw fields: close, open, high, low, volume. Built-in functions (case-sensitive, lowercase — no others exist, e.g. avg()/SMA() uppercase/close[N] bracket indexing are NOT supported): ema(series,period), sma(series,period), rsi(series,period), atr(period), adx(period), adxPlusDi(period), adxMinusDi(period), crossUp(a,b), crossDown(a,b), highest(series,n), lowest(series,n), change(series), volumeSma(period), volumeSpike(multiplier), body(), range(), upperWick(), lowerWick(), abs(x), min(a,b), max(a,b). Candlestick patterns (all no-arg, boolean, read only closed-candle OHLC, same in backtest and live): single-candle hammer(), shootingStar(), doji(), bullishMarubozu(), bearishMarubozu(), spinningTop(), dragonflyDoji(), gravestoneDoji(), longLeggedDoji(); two-candle bullishEngulfing(), bearishEngulfing(), piercingLine(), darkCloudCover(), bullishHarami(), bearishHarami(), haramiCross(), tweezerTop(), tweezerBottom(); three-plus-candle morningStar(), eveningStar(), threeWhiteSoldiers(), threeBlackCrows(), threeInsideUp(), threeInsideDown(), threeOutsideUp(), threeOutsideDown(), risingThreeMethods(), fallingThreeMethods(). Caveat: hammer()/shootingStar() are shape-only, no prior-trend check (same shape is Hammer in a downtrend but Hanging Man in an uptrend, and vice versa for shootingStar/Inverted Hammer) — pair with a trend/momentum condition rather than using the shape alone. An input may only reference inputs defined above it (no forward/circular references). Example: {\"emaFast\":\"ema(close, 9)\",\"emaSlow\":\"ema(close, 21)\"}"
  7. Changed2 schema fields changed
    • addedInput schema / properties / strategySnapshotJson / properties / configuration / properties / entryFeePct
      Added value: +{
      +  "description": "Simulated exchange fee on entry, as a percent (e.g. 0.1 = 0.1%). Omit/null = 0 (no fee, backward compatible). Subtracted from every trade's pnlR/pnlPct so results are net-of-fee by construction. 0-5 range. See the pnlR/expectancyR field descriptions on get_backtest_result for the R-vs-% caveat once a fee is set.",
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / strategySnapshotJson / properties / configuration / properties / exitFeePct
      Added value: +{
      +  "description": "Simulated exchange fee on exit, as a percent (e.g. 0.1 = 0.1%). Same semantics as EntryFeePct — real exchanges can charge different maker/taker rates per leg, so this is independent, not assumed equal.",
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
  8. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations are minimal (readOnlyHint=false, destructiveHint=false, idempotentHint=false), so the description carries the behavioral burden. It discloses immediate return behavior, per-asset id/status assignment, and best-effort error isolation for bad asset pairs. This adds meaningful context beyond the annotations, though it does not discuss broader failure modes like authentication errors or rate limits.

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 dense sentences cover purpose, benefit, return behavior, error semantics, and cross-references, with no filler. The primary action and distinguishing batch behavior are front-loaded before the secondary details about best-effort handling and confirmationSources.

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 an output schema exists and the input schema has 100% parameter coverage, the description is complete for invoking the tool correctly. It covers return values, the follow-up results tool, best-effort per-item errors, and the shared strategy/date-range semantics, while deferring the heavy DSL shape to submit_backtest appropriately.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The main description adds a useful pointer that strategySnapshotJson and confirmationSources share semantics with submit_backtest, but it does not add parameter meaning beyond what the input schema already thoroughly documents.

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 states a specific verb and resource: 'Submits ONE strategy against MANY asset pairs in a single call.' It clearly distinguishes itself from the sibling submit_backtest by emphasizing the batching benefit and the single-call semantics, so an agent can tell the two apart without opening schemas.

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 description explicitly frames the tool as the batched alternative to calling submit_backtest once per asset, and tells the agent to pass the returned batchId to get_backtest_batch_results. It gives clear context for when batch submission is appropriate, though it does not explicitly spell out when not to use it, such as when per-asset confirmationSources are needed.

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

Each tool maps to a distinct resource and action: submitting/fetching backtests, fetching batch results, fetching trades, submitting/fetching confirmation sources, fetching signals, and listing available assets. The singular vs. batch result tools are explicitly cross-referenced and serve different call patterns, so an agent shouldn't confuse them.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern: submit_*, get_*, and list_*. Resource names are clear and predictable, such as backtest, backtest_batch, backtest_trades, confirmation_source, and confirmation_source_signals. The list_/get_ verb variation is conventional and not confusing.

Tool Count5/5

Nine tools is well-scoped for this domain, covering single and batch backtests, result and trade retrieval, asset discovery, and the confirmation-source workflow. Each tool has a distinct role, and none feel like filler or duplication.

Completeness5/5

The tool set covers the full backtesting lifecycle: submit single/batch, fetch aggregate results, fetch trade detail, list available assets, and submit/fetch confirmation sources plus their signals. The confirmation-source workflow integrates cleanly with submit_backtest, and there are no dead ends or obvious missing operations.

Resources