Skip to main content
Glama

why

Trace an event ID's causal chain through parent links to its root cause, helping debug unexpected agent actions.

Instructions

Trace the causal chain that led to an event.

Given any event ID, walks back through parent_id links to reconstruct
the full decision tree: user message -> tool call -> result -> response.
Essential for debugging why an agent did something unexpected.

Args:
    event_id: The event you want to explain
    depth:    How many levels back to trace (default 10)

Returns:
    Ordered list of events from root cause to the specified event

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": {
      "event_id": "<event_id>"
    },
    "name": "why"
  }
}

Input Schema

NameRequiredDescriptionDefault
depthNo
event_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

No annotations exist, so the description carries the full load. It discloses the traversal mechanism and return ordering, which is genuinely useful, but leaves the safety profile implicit (it reads like a read-only walk but never says so) and says nothing about failure modes such as missing event IDs or truncated chains.

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 the action, then mechanism, then purpose, then structured Args/Returns blocks. Every line contributes; no filler or repetition of schema titles beyond the necessary param glosses.

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 two-parameter read tool with no output schema, the description covers mechanism, inputs, and the return format ('ordered list from root cause to the specified event'). Only edge-case behavior and an explicit read-only statement are absent.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate, and it does: event_id is explained as the event to explain and depth as 'How many levels back to trace' with the default of 10 restated. What's missing is behavior at the depth boundary, e.g. whether traversal stops silently or flags truncation.

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?

Specific verb+resource: 'Trace the causal chain that led to an event', with the mechanism spelled out ('walks back through parent_id links') and the chain shape illustrated (user message -> tool call -> result -> response). This functionally distinguishes it from a plain event-listing sibling, but no sibling is named, so it lands just short of 5.

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?

'Essential for debugging why an agent did something unexpected' gives a clear triggering context, and 'Given any event ID' establishes the precondition. It never states when not to use it or which sibling to prefer for non-causal lookups, so no exclusion guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.