Skip to main content
Glama

BotSpot: AI Trading, Backtests and Bots

Query deployment artifact data

query_deployment_artifact
Read-only

Runs a read-only DuckDB SELECT against queryable deployment artifacts listed in the run manifest. For replacement-deployment history, pass up to 10 exact {deploymentId, runId} targets; they are owner-checked, queried concurrently, 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.

Input Schema

NameRequiredDescriptionDefault
sqlYes
kindNoagent_detail
runIdNo
maxRowsNo
targetsNo
artifactKeyNo
deploymentIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true, so the description carries the rest and does so richly: targets are owner-checked, queried concurrently, returned with both IDs under one global maxRows limit; results are bounded to protect agent context; never mix a runId with another deploymentId. It also discloses a real safety constraint (which long text columns must never be raw-selected and that even MAX/ANY_VALUE over them is unsafe).

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 content is front-loaded with the core purpose and most sentences carry real operating constraints, but it is one very long unbroken block mixing query mechanics, output-safety rules, summarization instructions, and three full example queries. The example SQL paragraphs could be trimmed or structured, and the reading burden is high for a tool-selection decision.

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 7-parameter, no-output-schema, 0%-coverage SQL tool, the description supplies the query dialect, table name, row limits, prohibited columns, and worked examples – far more than adequate. The residual gap is the artifactKey/runId/deploymentId parameters, whose role in the call path is never made clear.

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 0%, so the description must compensate, and it does for sql (use table name `data`), kind (agent_detail example and memory kinds), targets (up to 10 exact {deploymentId, runId}, owner-checked) and maxRows (global limit, bounded). However runId as a top-level parameter, deploymentId and especially artifactKey are never explained, leaving three of seven parameters undocumented in both schema and description.

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 opening sentence states a specific verb and resource: a read-only DuckDB SELECT against queryable deployment artifacts listed in the run manifest. It differentiates from query_csv (same `data` table) and show_bot_activity, and explains the kind-based mode. It does not directly contrast with the similarly named get_deployment_artifact or list_deployment_artifacts, which an agent could easily confuse with it.

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 routing: 'Use show_bot_activity first for current account performance' and 'separate recorded bot telemetry readers are for targeted bot-attribution... not duplicate performance reports.' It also prescribes the internal workflow (start with aggregate SQL plus an ordered timeline with LIMIT) and names the specific question types (agent_detail + memory kinds for 'why did this bot buy NVDA?'). Both when-to-use and when-not-to-use are stated.

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.