Skip to main content
Glama

Get Trace Turns

get_trace_turns
Read-only

List the turns of one agent trace: where one prompt's work ends and the next starts.

A turn is one user (or system) prompt and everything the agent did to answer it. Each row gives the turn's span id, start and end (open while the agent is still working on it), who prompted it, its LLM and tool calls, its three most used tools, its errors, tokens and cost. A ≥ before the tokens means some LLM calls reported none, so the total is a floor. Find the turn's span id in get_agent_trace's waterfall to read that part of the trace. A trace without turn spans is reported as one turn covering every span.

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).

Example:

Which turn of trace 4bf92f3577b34da6a3ce929d0e0e4736 failed?

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

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_trace_turns"
  }
}

Input Schema

NameRequiredDescriptionDefault
trace_idYes
workspaceNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, and the description adds substantial behavior beyond that: the 'open' end-state sentinel for in-progress turns, the meaning of a '≥' prefix as a token floor when LLM calls omit usage, and the fallback that a trace without turn spans is reported as one turn covering every span. Those are precisely the non-obvious traits an agent needs to interpret results.

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?

Content is front-loaded: purpose first, then what a row contains, then parameter notes, then a concrete example. It is somewhat long and the row-contents sentence is dense, but nearly every clause adds operational meaning 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 an output schema present, the description need not document return values, yet it still summarizes row contents (span id, start/end, prompter, LLM and tool calls, top tools, errors, tokens, cost). Combined with the annotations and disambiguation guidance, an agent has everything needed to call and interpret this tool correctly.

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% and the schema itself has no property descriptions, so the description carries the full burden and does: trace_id is sourced from list_agent_traces, and workspace accepts an id, a name, or 'org-name/workspace-name' for the ambiguous case, defaults to the caller's default, and points to list_workspaces for discovery. This is richer than the raw 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 ('List the turns of one agent trace') and immediately defines what a turn is ('one prompt's work ends and the next starts'), which removes ambiguity about the unit of return. It also names the related sibling get_agent_trace, so the agent can distinguish this from a full-trace read.

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 explains the workflow relationship to get_agent_trace ('find the turn's span id in get_agent_trace's waterfall to read that part of the trace') and the input source for trace_id (list_agent_traces). It does not give an explicit 'use this instead of X when...' exclusion statement, keeping it short of a 5.

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.