Skip to main content
Glama

diagnose_trace

Identify where a long AI-agent run went wrong by reading the trace sequentially, detecting anomalies, and returning the 3 most likely root-cause steps to inspect first.

Instructions

Find where a long AI-agent run went wrong. Reads the trace chapter by chapter (never all at once), raises a CUSUM alarm, looks back, and returns the 3 steps to read first. trace: path to a .json trace or a Claude Code session .jsonl, or a LangSmith trace id. A trace under the length gate (default 50K tokens) or over the cost ceiling (default 250K tokens) is returned with gated true and a message saying which: it is not analysed and nothing is spent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
traceYes
sourceNoauto
projectNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
gatedYesTrue when the trace was not analysed and nothing was spent: it is empty, under the length gate, or over the cost ceiling. `message` says which.
anchorNo
messageYes
n_stepsYes
cost_usdNo
suspectsNo
n_chaptersNo
judge_callsNo
trace_tokensYes
alarm_chapterNo
judge_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does it well: it discloses that traces are read chapter by chapter, not all at once, that a CUSUM alarm is raised, that it looks back, and that gated traces are not analyzed and nothing is spent. This gives an agent an unusually clear picture of internal behavior and cost implications.

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 front-loaded with purpose, then method, then parameter guidance and gating. Every sentence adds useful information, though the CUSUM and 'looks back' jargon could be slightly clearer. Overall it is compact and well organized.

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 tool with no annotations and no siblings, the description covers purpose, trace input formats, gating thresholds, cost behavior, and expected output summary. The main gap is the undocumented source and project parameters, but the required parameter is sufficient to invoke the tool correctly.

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?

The 'trace' parameter is well explained with supported formats: .json, .jsonl, and LangSmith trace id. However, 'source' and 'project' are not described at all, and the schema has no descriptions, leaving them opaque. Since the required parameter is fully covered but optional ones are not, this is adequate but incomplete.

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 uses a specific verb and resource: 'Find where a long AI-agent run went wrong' and clearly states the outcome: returns the 3 steps to read first. It also distinguishes the tool's behavior (chapter-by-chapter reading, CUSUM alarm, lookback) from generic trace viewers, and there are no sibling tools that would create ambiguity.

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

Usage Guidelines4/5

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

The description gives clear context for when to use this tool: diagnosing a long AI-agent run. It also explains trace formats and gating behavior. However, it does not state exclusions or compare with alternatives, though none are provided as siblings, so this is acceptable.

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

Deploy Server

Other Tools