Skip to main content
Glama
dbsectrainer

mcp-agent-trace-inspector

by dbsectrainer

trace_step

Record a single step in an agent trace, capturing tool name, input, output, optional token count and latency for inspection and debugging.

Instructions

Record a single step within a trace. Captures tool name, input, output, optional token count and latency. Example: { "trace_id": "abc-123", "tool_name": "web_search", "input": {"query": "hello"}, "output": {"results": ["a","b"]}, "token_count": 50, "latency_ms": 320 }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesInput payload passed to the tool. Example: { "query": "weather in Paris" }
outputYesOutput/result returned by the tool. Example: { "result": "Sunny, 22°C" }. Add "error" field or "isError": true to flag errors.
trace_idYesID of the trace to record this step under. Example: "abc-123-def-456"
tool_nameYesName of the tool or action that was executed. Example: "web_search" or "llm_call"
latency_msNoOptional wall-clock latency of this step in milliseconds. Example: 450
token_countNoOptional number of tokens consumed in this step. Example: 150

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations establish this as a non-readOnly, non-destructive write, so the safety profile is covered. The description adds that token_count and latency_ms are optional, but says nothing about idempotency, whether steps append to an existing trace, prerequisite trace existence, or how errors are surfaced besides the schema-level 'isError' note.

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?

Two compact sentences front-load the purpose followed by a concrete example payload; every element earns its place. Slight redundancy in restating the fields the example already shows.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a nested-object write tool with no output schema, the description covers the call shape well but omits lifecycle context (trace must exist, ordering relative to trace_start/trace_end) and response behavior, leaving gaps an agent would need to resolve elsewhere.

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 coverage is 100% with per-field descriptions and examples, so the schema already carries the parameter meaning. The description's inline example reinforces the shape but adds no semantics beyond the schema, which is the expected baseline when structured data does the heavy lifting.

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?

The description states a specific verb and resource ('Record a single step within a trace') and enumerates what is captured, which lets an agent separate it from trace_start/trace_end and the read/export siblings. It stops short of explicitly contrasting itself with those siblings, so it is clear but not fully differentiated.

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

Usage Guidelines3/5

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

Usage is implied by the phrasing 'within a trace' and the example, suggesting it is called per step during a trace, but there is no explicit when-to-use guidance, no statement that a trace must already exist via trace_start, and no mention of the trace_end alternative. The agent must infer ordering from sibling names.

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