Skip to main content
Glama

BotSpot: AI Trading, Backtests and Bots

Check backtest status

backtest_status
Read-onlyIdempotent

Fetch the latest status/stage for a backtest by id. Response includes stage plus a rich structuredContent.progress snapshot of the current heartbeat:

  • percent, eta, elapsed, simulationDate, portfolioValue, totalReturnPct, heartbeatElapsedSeconds

  • orders: array of open/recent orders from the simulation's current iteration, sanitized to the same shape as get_deployment_order_telemetry — the 7 canonical fields (timestamp, symbol, action, quantity, price, order_id, status, reason) PLUS flat option/contract metadata (asset_type, strike, expiration, option_type, order_type) surfaced from the nested asset dict when the strategy trades options/futures so callers can render e.g. "SPY 2024-01-24 465 PUT smart_limit" without parsing OSI themselves. null if the heartbeat omits orders or the payload was malformed. Handles both live-listener Order.to_dict() and backtest-heartbeat Order.to_minimal_dict() shapes.

  • positions: array of current holdings sanitized to the same essential-fields shape as get_deployment_position_telemetry (symbol, quantity, avg_fill_price, current_price, market_value, pnl, pnl_percent, asset_type, exchange, currency, multiplier, expiration, strike, option_type, underlying_symbol, asset). Accepts both full Position.to_dict() and compact Position.to_minimal_dict() (qty/val/pnl) shapes.

  • dataProvider: the provider slug the backtest is routing through (e.g. botspot_auto, alpaca, polygon) so you can confirm routing mid-run without waiting for settings.json at completion. If you are monitoring, summarize those fields (progress + current results) instead of repeatedly polling. Finished runs also return rejectedOrderCount (null when not known yet) and errorSummary (first error line, null when none). A run waiting on market data returns dataWait (symbol, barSize, source, firstTimeDownload, waitingSeconds, slow, options best first, sayToPerson); a run that failed for missing bars returns dataProblem. When either is set, tell the person right away what it is waiting on and offer those options; do not just say it is still starting. After any slow or failed backtest, call once with includeTiming=true to see where the time went (timing.run, timing.data.sharedCache, timing.strategy) and, for failed runs, failureSummary (what failed and why, e.g. the asset, bar size and date of missing history). Numbers the run does not record are null and explained in timing.missing. For iteration counts and the slowest functions, rerun with start_backtest profile=true (profiling makes that run slower). To measure cold data speed, rerun with start_backtest cache="off".

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": {
      "backtestId": "<backtestId>"
    },
    "name": "backtest_status"
  }
}

Input Schema

NameRequiredDescriptionDefault
backtestIdYesActual backtest run UUID. Use the id returned by list_backtests or an explicit user-provided backtest id. Do not use a strategy id, aiStrategyId, revisionId, browser URL revisionId, conversation id, or a placeholder such as <unknown>.
includeTimingNoSet true after a slow or failed backtest to get `timing`: where the run spent its time (waiting to start, startup, simulation seconds, simulated days per minute, end-of-run reports, upload), shared market-data cache hits, misses and bytes, and, for runs started with start_backtest profile=true, iteration counts and the slowest functions. Numbers a run does not record are null and listed in `timing.missing` with the reason. Reads a few small result files, so leave it off while polling.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / includeTiming
      Added value: +{
      +  "description": "Set true after a slow or failed backtest to get `timing`: where the run spent its time (waiting to start, startup, simulation seconds, simulated days per minute, end-of-run reports, upload), shared market-data cache hits, misses and bytes, and, for runs started with start_backtest profile=true, iteration counts and the slowest functions. Numbers a run does not record are null and listed in `timing.missing` with the reason. Reads a few small result files, so leave it off while polling.",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already cover readOnly/idempotent/non-destructive, and the description goes far beyond: it enumerates the progress snapshot fields, explains null semantics ('null when not known yet'), notes sanitization across two payload shapes, and describes the dataWait/dataProblem states plus what the agent should tell the person. This is unusually rich behavioral disclosure for a status tool.

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

Conciseness3/5

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

Purpose is front-loaded and bullets organize the response fields, but the definition is very long and spends much of its length enumerating return-value fields, some of which read as implementation notes (OSI parsing, to_dict vs to_minimal_dict shapes). That detail is justified by the absence of an output schema, but it could be tightened considerably.

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?

With no output schema, the description carries the full burden of explaining returns and it does so thoroughly: progress fields, orders/positions shapes, dataWait/dataProblem, rejectedOrderCount, errorSummary, and timing. An agent has everything needed to call it and interpret the result.

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 coverage is 100%, so both backtestId and includeTiming are fully documented in the schema itself. The description reinforces includeTiming's purpose and cost ('Reads a few small result files') but adds little meaning beyond what the schema already states. Baseline 3 is appropriate.

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 verb+resource: 'Fetch the latest status/stage for a backtest by id.' It's clearly a status read, not a start/stop or artifact fetch, and it names start_backtest for follow-up profiling. It doesn't explicitly distinguish from siblings like get_backtest_logs or get_backtest_artifact, but the purpose itself is unambiguous.

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?

Strong contextual guidance: 'If you are monitoring, summarize those fields instead of repeatedly polling', 'After any slow or failed backtest, call once with includeTiming=true', and 'leave it off while polling'. It tells the agent when to escalate to includeTiming and how to interpret dataWait/dataProblem. It doesn't name alternative status tools, but it gives clear when-to-use rules for its own parameters.

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.