Skip to main content
Glama

Get Context Loss

get_context_loss
Read-only

Explain what an agent's context lost between two LLM calls of one session.

Use it when get_agent_trace shows a context drop (or a context_rot / CF-03 finding): the output lists the tokens before and after, whether the system prompt survived, which parts of the context shrank, the summary that replaced the dropped history (when one can be read) and the messages involved. The second span has to belong to trace_id; the first may sit in an earlier trace of the same session.

trace_id: the trace holding the later call (from get_agent_trace). from_span_id: the earlier LLM call's span id, as the Context drops list or the Context usage table of get_agent_trace names it. to_span_id: the later LLM call's span id, in trace_id. 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:

Why did the context drop at that call?

{
    "name": "get_context_loss",
    "arguments": {
        "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
        "from_span_id": "00f067aa0ba902b7",
        "to_span_id": "b7ad6b7169203331"
    }
}

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>",
      "from_span_id": "<from_span_id>",
      "to_span_id": "<to_span_id>"
    },
    "name": "get_context_loss"
  }
}

Input Schema

NameRequiredDescriptionDefault
trace_idYes
workspaceNo
to_span_idYes
from_span_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered. The description adds real behavioral context: what the output contains (token counts before/after, system-prompt survival, shrinking regions, replacement summary, involved messages) and the cross-trace span constraint. Slight redundancy with the existing output schema keeps it from a 5.

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?

Front-loaded with purpose and trigger, then parameter explanations, then a concrete example. The JSON example largely restates the parameter list and adds length without new meaning, but nothing else is wasted.

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 four-parameter read-only diagnostic tool with a rich output schema, the description covers purpose, trigger condition, span/trace relationship rules, workspace resolution, and expected content. Nothing an agent needs in order to call it correctly is missing.

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 description coverage is 0%, so the description carries the full burden and does: trace_id is the trace holding the later call, from_span_id is the earlier call's span as named in get_agent_trace's Context drops list, to_span_id is the later call within trace_id, and workspace explains name/id/org-qualified forms plus default behavior and list_workspaces discovery.

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 first sentence names a specific verb and resource: explain what an agent's context lost between two LLM calls of one session. It immediately differentiates itself from the sibling get_agent_trace by framing this as the follow-up analysis of a detected drop.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit trigger: 'Use it when get_agent_trace shows a context drop (or a context_rot / CF-03 finding)'. It also states the key precondition that the second span must belong to trace_id while the first may sit in an earlier trace of the same session, which is exactly the kind of constraint an agent could otherwise get wrong.

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.