Skip to main content
Glama

BotSpot: AI Trading, Backtests and Bots

Query deployment artifact data

query_deployment_artifact
Read-onlyIdempotent

Runs a read-only DuckDB SELECT against queryable deployment artifacts listed in the run manifest. For replacement-deployment history, pass up to 25 exact {deploymentId, runId} targets; they are owner-checked, queried 5 at a time, and returned with both IDs on every row under one global maxRows limit. Never combine a runId from one deployment with another deploymentId. Use table name data, the same as backtest query_csv. For kind-based queries such as agent_detail, the tool queries all manifest-listed hot/chunk Parquet or CSV files for that kind as one logical table. Use agent_detail plus memory_events/memory_retrievals/memory_state for questions like 'why did this live bot buy NVDA?' or 'why did it not buy anything?'. When summarizing team advice, preserve each recommendation and its stated reason, then explain the trader choice and actual order outcome. A brief reason per adviser is enough; separate earlier advice from the latest run and never invent an unrecorded reason for a hold. Results are bounded to protect agent context. For agent_detail, start with aggregate SQL plus at least one ordered timeline/excerpt query with LIMIT; aggregate counts alone are not enough to answer what the agent was doing. Use LEFT(long_text_column, N) for prompt/context/call text fields; never raw-select full effective_system_prompt, base_system_prompt, runtime_context_text, context_text, memory_state_text, event_payload_json, event_text, summary, or final_text. Aggregating a long text column does not make it safe: do not use MAX(summary), MAX(final_text), ANY_VALUE(summary), or ANY_VALUE(final_text) unless the aggregate is wrapped in LEFT(..., N). Useful agent_detail examples: SELECT event_kind, tool_name, COUNT(*) AS events FROM data GROUP BY event_kind, tool_name ORDER BY events DESC; SELECT call_index, event_index, event_kind, tool_name, LEFT(event_text, 500) AS event_text, call_input_tokens, call_output_tokens, call_latency_ms FROM data ORDER BY call_index, event_index LIMIT 50; SELECT call_index, MIN(timestamp) AS first_ts, MAX(timestamp) AS last_ts, MAX(agent_name) AS agent_name, LEFT(MAX(summary), 500) AS summary_excerpt, LEFT(MAX(final_text), 500) AS final_text_excerpt, MAX(call_input_tokens) AS input_tokens, MAX(call_output_tokens) AS output_tokens, MAX(call_latency_ms) AS latency_ms FROM data GROUP BY call_index ORDER BY call_index LIMIT 50. For scheduler AI-agent verification, query agent_detail for event_kind/tool_name counts, thinking events, call_thinking_tokens, call_input_tokens, call_output_tokens, call_latency_ms, summary excerpts, and final_text excerpts; query memory_events/memory_retrievals/memory_state to prove memory writes, retrieval provenance, and durable memory state across scheduled runs. Use show_bot_activity first for current account performance, holdings and recorded orders. Separate recorded bot telemetry readers are for targeted bot-attribution or fill investigations, not duplicate performance reports.

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": {
      "sql": "<sql>"
    },
    "name": "query_deployment_artifact"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
kindNoagent_detail
runIdNo
maxRowsNo
targetsNo
artifactKeyNo
deploymentIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / targets / maxItems
      Previous value: -10New value: +25
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the read-only annotations, it discloses owner-checking, batching of targets five at a time, a global maxRows bound, row-level inclusion of both deployment and run IDs, and the prohibition on mixing runId across deployments. It also explains result-size protections and warns against unsafe raw selection of long text fields.

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?

The purpose is front-loaded and most content is useful, but the description is a very dense single paragraph with repeated warnings and multiple long SQL examples that are hard to scan. It would benefit from structure and some consolidation while preserving the operational guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex seven-parameter query tool with no output schema, the description covers most operational behavior, query safety, and analysis patterns well. It still omits artifactKey semantics and does not fully enumerate all kind values or return-shape details, so it is strong but not complete.

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?

With 0% schema description coverage, the description compensates substantially by explaining targets, maxRows, kind-based behavior, and extensive SQL semantics including the `data` table and safe use of long text columns. However, it does not explain artifactKey or fully clarify top-level deploymentId/runId usage versus targets, leaving some parameter meaning to inference.

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: runs a read-only DuckDB SELECT against queryable deployment artifacts from the run manifest. It distinguishes itself from related tools by naming show_bot_activity as the first stop for account performance and by separating targeted telemetry readers from duplicate performance reports.

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 when-to-use guidance for replacement-deployment history, kind-based agent_detail queries, memory-related questions, and scheduler AI-agent verification. It also names alternatives such as show_bot_activity and recorded bot telemetry readers, making tool selection clear.

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.