Skip to main content
Glama

explain_trades

Inspect individual trades from a backtest run, applying filters like largest drawdown to pinpoint why a strategy underperformed and reveal the trades worth examining.

Instructions

Inspect individual trades from a run, filtered to the ones worth looking at. Use largest_drawdown to explain a bad result. Examples: explain_trades(run_id='a66d00139531003ef3abd6f9971de243'); explain_trades(run_id='a66d00139531003ef3abd6f9971de243', filter='largest_drawdown').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoWhich trades to return.worst_5
run_idYesThe run_id returned by run_backtest.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With zero annotations, the description must carry the behavioral burden. 'Inspect' and 'filtered to the ones worth looking at' imply a read/analysis operation rather than a raw dump, and the second sentence signals how filters shape output. But it does not explicitly state the operation is non-destructive, what the returned trade objects contain, or how output relates to the sibling get_run output.

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?

Three sentences with the core purpose first, followed by a usage hint and two runnable examples. The examples double as both API illustration and filter documentation, so the prose is efficient and earns its length.

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 2-parameter tool with an output schema present, the description is close to sufficient: both parameters are documented in the schema and the examples nail down invocation. The main residual gap is that the semantics of each remaining filter value (all_in_window in particular) are left to the schema's one-line 'Which trades to return.'

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 description coverage is 100%, so the schema already documents both parameters (run_id sourced from run_backtest; filter enum of trade selections). The description adds small extra meaning by foregrounding largest_drawdown for diagnosing bad results, which slightly exceeds the baseline 3 for fully-covered schemas.

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 description uses a specific verb ('inspect') and resource ('individual trades from a run') and clarifies the selection logic (filtered to the ones worth looking at). It is clear on what the tool does, though it doesn't explicitly name a sibling it is not (get_run and compare_runs are natural alternatives it leaves unaddressed).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete, instructive examples including a targeted hint ('Use largest_drawdown to explain a bad result') that tells the agent when a specific filter value is appropriate. However, it offers no when-not-to-use guidance for the other filters (worst_5, best_5, all_in_window) and no contrast against sibling tools like get_run or compare_runs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.