Skip to main content
Glama

Get Agent Trace

get_agent_trace
Read-only

Get one agent trace's span waterfall (spans in time order, indented by depth).

The header names the root span's agent and each row carries its own, so a multi-agent run shows which agent owned which span; pass either name back to list_agent_traces or list_spans as agent to see that agent's other work. The header also names who sent the trace — the sending ingest key's own email, which a console-made key usually carries too (it falls back to its creator's own email). Blank only when the key could not be resolved or the trace predates attribution.

The header also names the root span's session; pass it to list_spans(session_id=...) for the rest of that conversation. A session equal to the trace id means the run carried no session of its own. A trace whose spans carry more than one session gets a per-span session column.

When the silent-failure detectors reported findings on this trace, a "Silent failures" section lists each one: failure mode, subject, severity, state (retracted ones included), reason, evidence span ids and metrics. These are per-trace findings, not the swallowed_error alert rule kind (formerly silent_failure) that the alert tools manage.

When the trace compacted its context, a "Compactions" section lists each one, whether a compaction span or a rius.compaction event on an LLM call: when, span, trigger (auto, manual or unknown), kind, executor, tokens before and after, window and messages. The waterfall marks the compaction and the calls that ran on a compacted context. When LLM calls carry context, the waterfall gains cache r/w and ctx (prompt size / window and how full) columns, and a "Context usage" section lists each call's prompt size, cache tokens and largest shares. Any call whose prompt shrank by 30% or more against the previous call of the same agent is listed as a context drop, with the compaction between the two calls if there is one and the exact get_context_loss call that explains it: that answers "why did the context drop at this call?". The header also carries the trace's context line.

A context_rot finding (CF-03) names its subject: context_window (the window filled up), cutoff (the reply was cut off), a tool name (that tool's results dominate the context), lost (history disappeared without a recorded compaction), compacted (a compaction was recorded), thrashing (the agent kept compacting and refilling) or compacted_unmarked (info: an automatic compaction was inferred from the token drop, with no marker recorded).

trace_id: the trace id (from list_agent_traces). workspace: optional workspace id, name, or org-name/workspace-name when the same name occurs in two of your orgs (defaults to your default; use list_workspaces to discover them). include_content: when true, also return each span's captured content: LLM input/output messages, agent/tool input/output values, status messages and events. Off by default because full message content can be very large; pass true when you need to see what an LLM, agent, or tool span actually said, received, or returned (e.g. to inspect prompts, completions, or tool I/O).

Captured content is subject to the workspace's privacy controls: spans exported with capture_content=False or a mask have nothing extra to show.

Example:

Break down trace 4bf92f3577b34da6a3ce929d0e0e4736 for me.

{
    "name": "get_agent_trace",
    "arguments": { "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736" }
}

What did the LLM actually say in that failed span?

{
    "name": "get_agent_trace",
    "arguments": {
        "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
        "include_content": true
    }
}

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": {
      "trace_id": "<trace_id>"
    },
    "name": "get_agent_trace"
  }
}

Input Schema

NameRequiredDescriptionDefault
trace_idYes
workspaceNo
include_contentNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond readOnlyHint/openWorldHint, it discloses that content capture obeys workspace privacy controls (capture_content=False or masked spans show nothing extra), that attribution can be blank when the key is unresolved or predates attribution, that a session equal to the trace id means no real session, and that findings shown here are per-trace findings rather than the swallowed_error alert rule kind. These are real behavioral caveats an agent cannot get from annotations.

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

Conciseness3/5

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

Front-loaded correctly and organized into recognizable sections, but it is very long for a 3-parameter tool that already has an output schema. Large blocks (silent-failure section contents, the enumeration of context_rot subjects, compaction column details) describe return structure that the output schema could carry; useful for interpretation, but the volume exceeds what an agent needs to select and invoke the tool.

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?

For a read-only trace-inspection tool with a complex, sectioned output, the description covers the entry point (trace_id source), optional parameters, privacy caveats, and how to interpret the noteworthy sections. An agent has everything needed to call it correctly and read the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description carries the full burden and does: trace_id's source is named, workspace spells out accepted formats (id, name, org-name/workspace-name), default behavior, and list_workspaces for discovery, and include_content explains the default-off rationale (size) plus when to pass true. This is exactly the compensation needed for a 0%-coverage 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?

Opens with a precise verb+resource+output shape: 'Get one agent trace's span waterfall (spans in time order, indented by depth).' It immediately distinguishes itself from list_agent_traces and list_spans by naming them as the destinations for the names this tool surfaces, so an agent can tell the tools apart without opening a schema.

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 routing guidance: trace_id comes from list_agent_traces, agent names go back to list_agent_traces or list_spans, session goes to list_spans(session_id=...), and get_context_loss explains a specific drop. It does not state explicit when-not-to-use conditions (e.g., use list_agent_traces to enumerate traces instead), but the alternative-routing guidance is unusually concrete.

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.