Skip to main content
Glama

diagnose_trace

Read-onlyIdempotent

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "description": "A JSON object (returned as text in result.content[0].text). Diagnosis tools return {matched, family, fix, confidence, source, action_class, auto_safe, gate}; other tools return their own JSON result.",
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnly, idempotent, non-destructive), and the description adds substantial context beyond them: a fast path for known patterns (<1s) versus a ~25s LLM-backed path for novel failures, plus timeout and async-calling advice. That latency divergence is exactly the kind of behavior an agent must know to call this correctly.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and return shape, then a clearly labeled LATENCY paragraph. Every sentence earns its place, including the operational timeout/async warning, and nothing is redundant.

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 an output schema present, the description need not explain return values, yet it still summarizes the verdict fields for fast orientation. The only input is a nested trace object covered by the schema, and the latency/async behavior is fully disclosed, leaving no gap an agent needs filled.

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% with a single 'trace' parameter, so the schema carries parameter meaning. The description adds no syntax, format, or shape detail for the trace object beyond what the schema states, which is the baseline-3 case for a fully-covered schema.

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?

States a specific verb and resource ('Diagnose why an AI agent run failed') and names the exact output shape (failure_class, failed_at_step, root_cause, fix_suggestion, confidence). An agent can distinguish this from siblings like diagnose_batch or diagnose_infra_error, which operate on different scopes.

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?

Gives clear context (a failed agent run) and explicit operational guidance: set client timeout to 30s and don't block the agent loop. It does not explicitly distinguish this single-trace tool from the batch or infra-error diagnosis siblings, so routing among those is left to inference.

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.