Skip to main content
Glama

Diagnose Strategy

tt_diagnose_strategy
Read-onlyIdempotent

⭐ THE go-to tool for "why is my strategy in error / why didn't it trade / what happened to SID ?". ONE call that fuses everything the support team needs into a single DIAGNOSIS CARD: the deployment record (name / status / mode), the ENGINE log (which entry/exit conditions actually fired + any engine errors), and the BROKER log (orders placed, order statuses, broker name, and genuine broker-side failures like RMS / margin / token / auth rejections).

Prefer this over calling the individual log tools when the user is asking what's WRONG — it gathers all evidence at once. The tool returns structured card evidence + a render_spec; YOU then present the card and add the two sections that are the real value: • ANALYSIS — the root cause and WHICH LAYER it's at (broker vs a strategy condition). Map the fired condition_id to the strategy's logic; if you need the condition's definition, follow up with tt_get_strategy. Don't invent a cause the logs don't support. • RECOMMENDATION — the concrete fix (re-auth/add-margin at the broker, or edit a specific condition, or 'no action — exited as designed'). Lead it with the recommended_action field — the next step, from the triage or from a cause read from the strategy's own template (action enum + next_step + doc link + optional next_tool, e.g. re-run at a wider window). next_tool is a suggestion to offer the user; it is run only when the user asks for it.

AUTH-REQUIRED and OWNERSHIP-GATED + fail-closed: the SID is reverse- looked-up against the caller's account first; not theirs (or an inconclusive lookup) ⇒ REFUSE, read nothing.

strategy_id is the deployed strategy id (SID); resolve via tt_get_my_deployed_strategies if the user names a strategy. window_minutes default 1440 (a full day), max 1440.

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": {
      "strategy_id": "<strategy_id>"
    },
    "name": "tt_diagnose_strategy"
  }
}

Input Schema

NameRequiredDescriptionDefault
strategy_idYes
window_minutesNoLog lookback in minutes, 1..1440 (a full day). Default 1440. A larger value is clamped to 1440 (the log cannot be read further back than a day); below the minimum is refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, it discloses that the call is auth-required, ownership-gated through a reverse SID lookup, and fail-closed — a non-owned or inconclusive lookup means REFUSE and read nothing, which an agent otherwise could misread as a bug. It also describes the return shape (structured `card` plus `render_spec`, plus a `recommended_action` with action enum, next_step, doc link, and optional next_tool) and clarifies that next_tool is only a suggestion.

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 purpose and the sibling preference are front-loaded before any detail, and the bullets keep the card contents and the follow-up workflow scannable. It is on the long side and repeats the 1440 default/max already present in the schema, and a large share of the text is agent-side presentation guidance rather than tool 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?

There is no output schema, and the definition covers what comes back (`card` evidence, `render_spec`, `recommended_action` fields) plus the two parameters and the auth/refusal behavior. Nothing an agent needs in order to call it correctly or interpret a refusal 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 50% because strategy_id carries no inline description; the definition compensates by defining it as the deployed SID and giving a resolution path when the user names a strategy instead. For window_minutes it mostly restates the schema's default and 1440 clamp, adding only the note that out-of-range values are clamped or refused.

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 opening line names the exact question the tool answers ("why is my strategy in error / why didn't it trade / what happened to SID <x>") and specifies the concrete payload: deployment record, engine log, and broker log fused into one diagnosis card. It explicitly distinguishes itself from the individual log siblings, so an agent can choose without opening the 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?

It states the selection rule outright ("Prefer this over calling the individual log tools when the user is asking what's WRONG") and gives follow-up routing: use tt_get_my_deployed_strategies to resolve a named strategy, and tt_get_strategy when a fired condition_id needs its definition. It also tells the agent not to invent causes the logs don't support, which bounds the tool's use.

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.

Resources