Skip to main content
Glama

Snapback

diagnose_trace

Diagnose why an AI agent run failed. Returns a structured verdict (failure_class, failed_at_step, root_cause, fix_suggestion, confidence). LATENCY: known patterns return library-instant (<1s); a NOVEL failure needs an LLM call and can take up to ~25s — set your client timeout to at least 30s, and treat this as async (don't block your agent loop on it).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
traceYesOTel-shaped agent trace

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Since no annotations are provided, the description carries the full burden of behavioral disclosure. It goes beyond a simple read/write note by detailing latency behavior (instant for known patterns vs. up to 25s for novel failures), advising a timeout of 30s, and recommending async handling. It does not state side effects, but the diagnosis tool is presumably non-mutating; this is reasonable given the context. The latency disclosure is particularly useful.

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 two sentences, front-loaded with the core purpose, followed by operational latency guidance. There is minimal wasted text, and the structure is logical: what it does, then important usage caveat. It is concise without under-specifying.

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 one parameter and no output schema, the description is fairly complete: it lists the returned verdict fields, explains latency variability, and gives a timeout suggestion. It does not explain how to interpret the verdict fields in detail, but that is likely self-explanatory. The inclusion of the latency information fills a gap that schema/annotations lack. Overall, an agent has enough to decide when and how to invoke it.

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 100% — the single parameter 'trace' has a description ('OTel-shaped agent trace'). The tool description does not add further detail about the structure or format of the trace beyond what the schema already states. Per the rubric, with high schema coverage, a score of 3 is the baseline; the description adds no extra value for parameters.

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 clearly states what the tool does: 'Diagnose why an AI agent run failed' and lists the verdict fields returned. It is specific about the verb and resource, but it does not explicitly distinguish it from sibling tools like diagnose_batch or detect_loop, which are also diagnosis-related. The purpose is unambiguous enough for an agent to recognize its role.

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 when to use the tool (when a run fails) but does not explicitly state when to avoid it or direct the agent to alternatives in the sibling set (e.g., detect_loop for loop detection or diagnose_infra_error for infrastructure issues). It provides latency guidance that could influence usage, but lacks explicit exclusions or comparisons.

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.