Skip to main content
Glama

BotSpot: AI Trading, Backtests and Bots

Start a backtest

start_backtest
Destructive

Start a new backtest for a revision with the provided date range. ASYNC: This starts a job and returns immediately with a backtest id. backtest_status and artifact tools expose the current state for that id. Backtests are asynchronous and can consume material runtime capacity. Follow the user's instructions about whether to start one. This tool does not create or update visible plan items. Its structured result factually reports the backtest id, revision id, durable external wait id (when created), and Agent run status. If revisionId is missing, call list_backtests first and use the Tool IDs section to obtain revisionId/aiStrategyId/strategyId. IMPORTANT: This tool always uses the conversation's configured data provider (defaults to 'botspot_auto' if none is set). Do not call set_data_provider merely to reselect the default. Only when the requested provider is available according to its advertised availability constraints, call set_data_provider first to honor an explicit provider change (inside BotSpot chat you cannot pass a provider directly to this tool). Do not call either tool to probe a provider already declared OFF. Explain that no source changed and no backtest started, offer a supported alternative for the saved assets, and ask which route to use. MCP clients without a BotSpot chat conversation (Claude, ChatGPT, Codex) cannot call set_data_provider; they pass dataProvider (for example alpaca or polygon) on this call instead. The revisionId must be the id from the most recent successful file mutation or readback in this workflow. Every later file mutation supersedes every earlier revision id, even when the later mutation edits the same file. Optional: Provide budget (starting cash) to run the backtest as-if the account started with that amount. This sets BACKTESTING_BUDGET in the backtest environment so it works without modifying strategy code. Use envVarSetIds for saved runtime secrets and data-provider API keys. Do not pass raw env vars, botConfig, API keys, CSV rows, JSON row dumps, workbook data, or inline secret material. Create one saved environment variable at a time with saved_env_vars(action="create") first, then pass returned ids here. Optional: Provide parameters (dict) to override strategy parameters at runtime (e.g. ALLOCATION, symbol, pct_to_trade). BotSpot saves them as an immutable strategy parameter set that can be reused by a backtest or live bot. You may instead pass strategyParameterSetId for this exact saved revision.

IMPORTANT - Handling DATA_ACCESS_REQUIRED errors: If you receive a DATA_ACCESS_REQUIRED or TRIAL_RANGE_EXCEEDED error, this means the user's trial has expired or they need to purchase access. DO NOT attempt to switch to a different data provider (like Polygon or Alpaca) - the user needs to UPGRADE their access to the current provider. Explain that they need to unlock the data add-on for the provider being used (e.g., Theta Data Options). A modal will appear automatically to help them purchase access - do NOT suggest switching providers as a workaround.

IMPORTANT - Handling DATA_PROVIDER_UNAVAILABLE and OPTIONS_DATA_SOURCE_REQUIRED: These mean the data source cannot return data right now (Theta Data is off), so no backtest was started. Do not retry the same backtest. Tell the user plainly what happened and list the alternatives from the result: BotSpot Auto for stocks, indexes, crypto and futures; for options, the user's own connected Alpaca account or their own Polygon API key. Ask which one they want, then call set_data_provider. Never describe this as a problem with their strategy.

Input Schema

NameRequiredDescriptionDefault
budgetNoStarting cash for the backtest (in the quote currency, typically USD). Sets BACKTESTING_BUDGET in the backtest environment.
endDateYes
startDateYes
parametersNoStrategy parameters to override at runtime (e.g. ALLOCATION, symbol, pct_to_trade). BotSpot saves these as an immutable strategy parameter set reusable by backtests and live bots.
revisionIdNo
dataProviderNoOnly for MCP clients without a BotSpot chat conversation (Claude, ChatGPT, Codex): the data source for this backtest, e.g. botspot_auto, alpaca, polygon. Inside BotSpot chat, use set_data_provider instead; this field is refused there.
envVarSetIdsNoSaved BotSpot environment variable IDs to inject into the backtest runner. The MCP server never reads or exposes the saved values; BotSpot issues a short-lived runtime secret for the backtest.
strategyParameterSetIdNoExisting immutable strategy parameter set for this exact saved revision.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the single destructiveHint annotation, the description discloses that the operation is asynchronous and returns immediately with an id, that it consumes material runtime capacity, that it does not create plan items, what the structured result contains, and how three distinct error classes (DATA_ACCESS_REQUIRED, DATA_PROVIDER_UNAVAILABLE, OPTIONS_DATA_SOURCE_REQUIRED) should be surfaced to the user without retrying or switching providers. This is substantially more than the annotation conveys, with no contradiction of destructiveHint.

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 purpose and async behavior, then organized under explicit IMPORTANT headings for error handling, so scanning works. It is verbose in places — provider routing is explained twice (once inline, once under the error sections) and the 'explain/offer/ask' instructions are wordy — but nearly every sentence carries operational value for a high-stakes async job.

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, expensive, async tool with 8 parameters and no output schema, the description covers launch semantics, the shape of the structured result, prerequisite discovery, secret handling, provider resolution, and recovery paths for each error class. An agent has enough to call it correctly and to handle failures without guessing.

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?

Schema coverage is only 63%, but the description compensates thoroughly: it explains budget semantics (sets BACKTESTING_BUDGET so no code changes are needed), how envVarSetIds must be pre-created via saved_env_vars rather than passing raw secrets, that parameters become an immutable reusable parameter set, the exact-revision constraint on strategyParameterSetId, and the client-dependent behavior of dataProvider. It also clarifies that revisionId must come from the most recent successful file mutation, including the supersession rule.

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?

Opening sentence gives a specific verb+resource ('Start a new backtest for a revision with the provided date range') and immediately distinguishes itself from siblings by naming `backtest_status`, artifact tools, and `list_backtests` as the consumers/producers of the returned id. An agent can tell exactly what this does versus `stop_backtest`, `list_backtests`, or `start_parameter_experiment`.

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?

Explicit guidance on when to call it ('follow the user's instructions about whether to start one'), what to do when prerequisites are missing (call `list_backtests` for revisionId), and when not to call related tools ('do not call set_data_provider merely to reselect the default', 'do not call either tool to probe a provider already declared OFF'). It also routes provider changes to the correct alternative per client type, which is exactly the alternatives guidance this dimension rewards.

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.