Skip to main content
Glama

BotSpot: AI Trading, Backtests and Bots

Fetch backtest logs

get_backtest_logs
Read-only

Fetch runtime logs for an identified historical backtest simulation. This tool does not read live/paper bot or scheduled-deployment logs. Use get_deployment_logs for those runtime logs and list_deployment_artifacts/query_deployment_artifact for decisions, preserving the discovered deploymentId and runId. A deploymentId or deployment runId is not a backtestId. Use this, not get_backtest_artifact or query_csv, for backtest runtime errors, warnings, tracebacks, startup lines, order/fill log lines, broker messages, strategy print/log output, and questions like why a backtest failed or why it made no trades. backtestId must be the actual backtest run id from list_backtests or an explicit user-provided backtest id; never pass a strategy id, aiStrategyId, revisionId, browser URL revisionId, conversation id, or placeholder such as . Keep the same backtestId for every log/artifact/query call in one answer unless the user explicitly asks to compare multiple runs. Do not mix stats/trades/agent_detail/log evidence from different backtest ids. Supports time-range filtering (startTimeIso/endTimeIso), CloudWatch filter patterns (query), local multi-query diagnostics (queries), diagnosticPreset, noise suppression, pagination (nextToken), and grep-style context lines. Default limit is bounded; use limit near 1000 when diagnosing failures. For failed/no-trade/runtime-failure backtests, logs are mandatory evidence before editing code when logs are available. Prefer one batched queries call with at least three bounded searches: errors/exceptions/tracebacks, orders/trades/fills/positions, and strategy/runtime/main.py/on_trading_iteration lines. A single newest-first page or one warning line is not enough for root cause. For completed-backtest performance-improvement or tuning questions, this tool is also required evidence when logs are available; stats/trades/agent_detail queries do not replace runtime log checks. Use one batched queries call covering errors/exceptions, order/trade/fill/position activity, and strategy/runtime lines before final advice. diagnosticPreset values: broker_order_failure searches broker/order rejects, permission failures, and tracebacks; runtime_failure searches crashes, imports, dependency/build failures, kills, and exceptions; startup searches startup/stream/broker initialization; orders searches order/fill/cancel/reject activity. Pass contextLines (0-50) with query, queries, or a preset to preserve surrounding lines. When contextLines, queries, diagnosticPreset, or noise suppression is set, the tool fetches one bounded raw CloudWatch window and filters locally so surrounding context is preserved. The response includes runtimeProvenance. It uses the exact run's structured settings.json.lumibot_version as the primary source, then the canonical bootstrap package-metadata line INFO: lumibot version: ... from the fetched raw CloudWatch window as a fallback or corroborating source. It reports conflicts instead of choosing one value, and preserves provenance even when the requested filtered log view omits the startup line. Treat runtimeProvenance.runtimeVersion as the installed runtime version only when its status is confirmed; a LumiBot source/reference version is not runtime evidence. The response also includes logs, perQuery match counts, totalLines, scannedLines, returnedLines, scannedStart/scannedEnd timestamps when visible, noiseSuppressedLines, truncatedQueryCount, nextToken, and paginationWarning when more pages may need checking. Broad queries are capped; if truncatedQueryCount is nonzero, run a narrower follow-up query. Do not substitute runtime log CSV artifacts.

Input Schema

NameRequiredDescriptionDefault
sortNo
limitNo
queryNo
queriesNo
nextTokenNo
backtestIdYesActual backtest run UUID for a historical simulation, from list_backtests or an explicitly identified user-provided backtest. A bot/deployment id or a list_deployment_runs runId is not a backtestId: use get_deployment_logs with that deploymentId instead. Do not use a strategy id, aiStrategyId, revisionId, browser URL revisionId, conversation id, or a placeholder such as <unknown>.
endTimeIsoNo
contextLinesNo
startTimeIsoNo
suppressNoiseNo
diagnosticPresetNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnlyHint; the description adds substantial behavior: bounded raw CloudWatch window fetching with local filtering when context/preset/noise flags are set, broad-query caps with truncatedQueryCount signaling a narrower follow-up, and default limit bounding. It also discloses runtimeProvenance semantics (settings.json primary, log-line fallback, conflict reporting, confirmed-only trust) that no structured field conveys.

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?

Front-loaded with purpose and exclusions, but it is a dense monolith that repeats the same 'one batched queries call with errors/orders/strategy searches' instruction twice in near-identical form, and repeats the invalid-id list that the backtestId schema field already contains verbatim. Strong content, notable redundancy.

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 an 11-parameter tool with 9% schema coverage and no output schema, the description supplies both the response shape (logs, perQuery counts, totalLines, scannedLines, returnedLines, scanned window timestamps, noiseSuppressedLines, truncatedQueryCount, nextToken, paginationWarning) and the runtimeProvenance contract. Nothing an agent needs to call it correctly and interpret results is missing.

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 9%, so the description must carry the load, and it largely does: query/contextLines/noise suppression relationship, all four diagnosticPreset values explained individually, queries as a batched alternative to query, limit near 1000 for diagnosis, startTimeIso/endTimeIso range filtering. Gaps remain — `sort` is never mentioned and nextToken/pagination semantics are only implied through output fields.

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?

Opens with a specific verb+resource+scope: 'Fetch runtime logs for an identified historical backtest simulation,' and immediately draws the boundary against live/paper bot and scheduled-deployment logs. An agent can distinguish it from get_deployment_logs, get_backtest_artifact, and query_csv without opening any schema.

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 states when NOT to use it (get_deployment_logs for deployment runtime logs, list_deployment_artifacts/query_deployment_artifact for decisions) and enumerates the exact question types it answers (errors, tracebacks, startup lines, fills, broker messages, 'why did this fail'). It also mandates evidence gathering before code edits and names the concrete batching pattern.

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.