Skip to main content
Glama

Triage Trace

triage_trace
Read-onlyIdempotent

Identify the likely root cause of a trace by analyzing error chains and span self-time, returning a compact diagnosis instead of raw trace data.

Instructions

Synthesize a likely-root-cause diagnosis for a trace, instead of returning raw trace data for the caller to re-derive one from every time.

Computes a critical path (the "Last Finishing Child" chain actually responsible for the trace's total latency), ranks spans by self-time (latency contribution net of children, top 10), and - when the trace contains an error anywhere under any root span - identifies the deepest error span in the trace's error chain as the likely root cause. Falls back to the highest self-time span as a pure-latency diagnosis when no error is present. Deterministic (no LLM call); works against any configured backend.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trace_idYesTrace identifier
detail_levelNo"summary" (default) returns a compact diagnosis only - this differs from get_trace's own "full"-by-default, since a triage result is already a small synthesized diagnosis rather than a raw data dump, so there is no unbounded-by-default payload to guard against here. "full" additionally attaches the diagnosed root cause's raw error detail (message/type/ stacktrace) to both the verdict and the matching error_chain entry, when the verdict is error-driven.summary

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
verdictYesThe synthesized root-cause diagnosis triage_trace produces. likely_root_cause is None only when the trace has no spans at all (a backend returned an empty TraceData) - every non-empty trace always finds a candidate, since the pure-latency fallback (confidence="low") applies whenever no error chain exists.
trace_idYes
error_chainYes
critical_pathYes
top_latency_contributorsYesTop spans by self-time (latency contribution net of children) across the whole trace, capped at 10 entries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.12.2

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already establish readOnly, idempotent, openWorld, and non-destructive behavior. The description adds valuable behavioral context beyond those annotations: it explicitly states the algorithm (Last Finishing Child critical path, self-time top 10, deepest error span), the fallback behavior when no error exists, determinism (no LLM call), and backend independence. There is no contradiction with the annotations.

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 the core purpose in the first sentence and then expands into useful algorithmic detail. It is somewhat long, with multiple clauses in the detail_level explanation, but every sentence contributes substantive behavioral or semantic information rather than filler.

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?

With a rich output schema, comprehensive annotations, and a description that covers the algorithm, fallback behavior, determinism, and parameter semantics, nothing essential is missing for an agent to decide when to invoke this tool and what it will receive. The trace_id parameter is simple enough that the schema's 'Trace identifier' plus the overall context is sufficient.

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?

The input schema already provides 100% description coverage for both parameters. The description adds meaningful detail_level semantics, explaining what 'summary' returns, how 'full' expands the payload, and how this differs from get_trace's default. This goes beyond the schema's enum text and justifies a score above the baseline.

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 opens with a specific, informative verb phrase: 'Synthesize a likely-root-cause diagnosis for a trace, instead of returning raw trace data.' This clearly states what the tool does and distinguishes it from raw-data tools like get_trace. It also names the computed outputs (critical path, self-time ranking, error-root-cause) unambiguously.

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?

The description implies usage context by framing the tool as an alternative to re-deriving diagnoses from raw trace data, and it mentions the deterministic no-LLM behavior. However, it never explicitly names an alternative tool to use instead when raw data is needed, nor does it state a 'when to use / when not to use' rule. The guidance remains implicit rather than prescriptive.

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