Skip to main content
Glama

BotSpot: AI Trading, Backtests and Bots

Fetch deployment logs

get_deployment_logs
Read-onlyIdempotent

Returns CloudWatch logs from a live deployment's container. Supports time-range filtering (startTimeIso/endTimeIso), CloudWatch filter patterns (query), local multi-query diagnostics (queries), diagnosticPreset, noise suppression, and pagination (nextToken). Default limit is 500 lines, newest first. Use this to debug bot errors, check trading activity, or verify a strategy is running correctly. For failed/stalled deployments, prefer diagnosticPreset="broker_order_failure" or diagnosticPreset="runtime_failure" with contextLines=5-10 and limit near 1000 before concluding root cause. A single newest-first page or one warning line is not conclusive when nextToken is present or deprecation warnings dominate the page.

diagnosticPreset values: broker_order_failure searches broker/order rejects, permission failures, Alpaca 403/40310000, 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. Prefer queries for multiple explicit regex searches in one call when diagnosis needs more than one angle. A good deployment-failure call uses at least three bounded queries: errors/exceptions/tracebacks, broker/order/fill/reject/position activity, and startup/runtime/strategy lines. This avoids wasting turns on one narrow search and makes missing evidence more meaningful. The response includes perQuery match counts, totalLines, scannedLines, returnedLines, scannedStart/scannedEnd timestamps when visible, noiseSuppressedLines, truncatedQueryCount, and paginationWarning when more pages may need checking. Broad queries are capped; if truncatedQueryCount is nonzero, run a narrower follow-up query.

Pass contextLines (0-50) together with query to get grep-style output — only lines matching the pattern plus N surrounding lines on each side, -- between non-contiguous groups. When contextLines is set, the CloudWatch-side filter is suppressed and filtering runs locally on the raw fetched window so surrounding lines are preserved (CloudWatch's filterPattern strips context). query is treated as a JavaScript regex (case-insensitive), with a literal-substring fallback if the regex is invalid. The response also includes totalLines, returnedLines, and matchCount so you know how much was filtered.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_deployment_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
sortNo
limitNo
queryNoCloudWatch filter pattern when contextLines is omitted. For a case-insensitive JavaScript regex such as ERROR|Exception, set contextLines (0 means matching lines only), or use queries instead.
queriesNoCase-insensitive JavaScript regex searches applied locally to the fetched log page.
nextTokenNo
endTimeIsoNo
contextLinesNoApply query locally as a regex and include this many surrounding lines. Zero returns matching lines only and still avoids CloudWatch filter syntax.
deploymentIdNo
startTimeIsoNo
deployment_idNoAlias for deploymentId.
suppressNoiseNo
diagnosticPresetNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / deployment_id
      Added value: +{
      +  "$ref": "#/properties/deploymentId",
      +  "description": "Alias for deploymentId."
      +}
    • changedInput schema / properties / queries / maxItems
      Previous value: -10New value: +25
    • removedInput schema / required
      Removed value: -[
      -  "deploymentId"
      -]
  2. Changed3 schema fields changed
    • addedInput schema / properties / contextLines / description
      Added value: +"Apply query locally as a regex and include this many surrounding lines. Zero returns matching lines only and still avoids CloudWatch filter syntax."
    • addedInput schema / properties / queries / description
      Added value: +"Case-insensitive JavaScript regex searches applied locally to the fetched log page."
    • addedInput schema / properties / query / description
      Added value: +"CloudWatch filter pattern when contextLines is omitted. For a case-insensitive JavaScript regex such as ERROR|Exception, set contextLines (0 means matching lines only), or use queries instead."
  3. Changed1 schema field changed
    • changedInput schema / properties / diagnosticPreset / enum
      Previous value: -[
      -  "broker_order_failure",
      -  "runtime_failure",
      -  "startup",
      -  "orders"
      -]New value: +[
      +  "broker_order_failure",
      +  "runtime_failure",
      +  "startup",
      +  "orders",
      +  "errors_and_warnings",
      +  "performance"
      +]
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the read-only and idempotent annotations, the description discloses default limit, newest-first ordering, CloudWatch-side filter suppression when contextLines is set, local regex fallback behavior, broad-query caps, truncation warnings, and numerous response metadata fields. These behaviors materially affect how an agent should interpret and paginate results.

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?

The description is long but mostly earns its length because the tool has 12 parameters, multiple search modes, and no output schema. It is front-loaded with purpose and key behavior, though there is some redundancy around returned metadata fields and repeated explanation of regex/context-line behavior.

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 deployment-log tool with no output schema and low schema description coverage, the definition is highly complete: it explains search modes, presets, pagination, filtering behavior, response fields, and diagnostic best practices. Missing parameter notes such as `sort` are minor relative to the overall coverage.

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 only 33%, but the description compensates strongly for the high-value parameters by explaining time-range filtering, query versus queries, diagnosticPreset values, contextLines semantics, suppressNoise, nextToken pagination, and default limit. However, it leaves `sort`, `deploymentId`, and the `deployment_id` alias largely unexplained, so it does not fully cover all 12 parameters.

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: it returns CloudWatch logs from a live deployment's container. The deployment scope clearly distinguishes it from backtest log retrieval, and the follow-on details reinforce that this is a live deployment log inspection tool.

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?

It gives explicit use cases: debug bot errors, check trading activity, or verify a strategy is running. It also provides conditional guidance for failed/stalled deployments, recommends specific diagnosticPreset values over a plain page, and tells the agent when to prefer `queries` for multiple regex searches.

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.