mcp-agent-trace-inspector
v1.0.1Step-by-step observability for MCP agent workflows
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
trace_start
Begin a new agent workflow trace. Returns a trace_id to use with subsequent calls. Example: { "name": "My Search Workflow" }. Pass "auto" or leave name blank for an auto-generated name.
| Parameter | Type | Description |
|---|---|---|
name * | string | Human-readable name for this trace/workflow run. Example: "Product Search Workflow 2024-01-15". Pass "auto" to auto-generate. |
trace_step
Record a single step within a running trace. Captures tool name, input, output, optional token count and latency. Steps cannot be added after trace_end. Example: { "trace_id": "abc-123", "tool_name": "web_search", "input": {"query": "hello"}, "output": {"results": ["a","b"]}, "token_count": 50, "latency_ms": 320 }
| Parameter | Type | Description |
|---|---|---|
input * | object | Input payload passed to the tool. Example: { "query": "weather in Paris" } |
output * | object | Output/result returned by the tool. Example: { "result": "Sunny, 22°C" }. Add "error" field or "isError": true to flag errors. |
tool_name * | string | Name of the tool or action that was executed. Example: "web_search" or "llm_call" |
trace_id * | string | ID of the trace to record this step under. Example: "abc-123-def-456" |
latency_ms | number | Optional wall-clock latency of this step in milliseconds. Example: 450 |
token_count | number | Optional number of tokens consumed in this step. Example: 150 |
trace_end
Mark a trace as completed and evaluate the currently configured alert rules. Further trace_step calls for this trace are rejected. Example: { "trace_id": "abc-123" }
| Parameter | Type | Description |
|---|---|---|
trace_id * | string | ID of the trace to complete. Example: "abc-123-def-456" |
get_trace_summary
Retrieve a summary of a trace including step count, total tokens, total latency, cost estimate, and reasoning chain detection. Example: { "trace_id": "abc-123", "model": "claude-sonnet-4-6" }
| Parameter | Type | Description |
|---|---|---|
trace_id * | string | ID of the trace to summarize. Example: "abc-123-def-456" |
model | string | Model name for cost estimation. Example: "claude-sonnet-4-6". Defaults to "claude-sonnet-4-6". |
list_traces
List all stored traces with their names, statuses, and timestamps. Example: { "limit": 10 } to get the 10 most recent traces.
| Parameter | Type | Description |
|---|---|---|
limit | number | Maximum number of traces to return (most recent first). Example: 20. Omit for all. |
export_dashboard
Generate a self-contained HTML dashboard for a trace with error highlighting and latency waterfall visualization. Returns the full HTML as a string. Example: { "trace_id": "abc-123" }
| Parameter | Type | Description |
|---|---|---|
trace_id * | string | ID of the trace to export. Example: "abc-123-def-456" |
compare_traces
Compare two traces side by side: step counts, tokens, latency, and step-by-step differences. Example: { "trace_id_a": "abc-123", "trace_id_b": "def-456" }
| Parameter | Type | Description |
|---|---|---|
trace_id_a * | string | ID of the first trace (baseline). Example: "abc-123" |
trace_id_b * | string | ID of the second trace (to compare against). Example: "def-456" |
extract_reasoning_chain
Extract only the reasoning/thinking steps from a trace. Returns steps whose tool_name matches reasoning patterns (reason, think, plan, reflect, analyz, consider) or whose input/output content includes the word "think". Example: { "trace_id": "abc-123" }
| Parameter | Type | Description |
|---|---|---|
trace_id * | string | ID of the trace to extract reasoning from. Example: "abc-123-def-456" |
export_otel
Export trace(s) as an OTLP/JSON document (resourceSpans → scopeSpans → spans) suitable for an OTLP collector or backend. Omit trace_id to export all traces. Example: { "format": "json" } or { "trace_id": "abc-123", "format": "json" }
| Parameter | Type | Description |
|---|---|---|
format * | string | Export format. Currently only "json" is supported. |
trace_id | string | Optional trace ID to export. Omit to export all traces. |
configure_alerts
Persist alert rules for latency, error rate, or cost thresholds. Rules are evaluated on trace_end; optional Slack or generic webhooks deliver fired alerts. Example: { "rules": [{"type":"latency","threshold":1000}], "slack_webhook": "https://hooks.slack.com/..." }
| Parameter | Type | Description |
|---|---|---|
rules * | array | Array of alert rules to configure. |
slack_webhook | string | Optional Slack webhook URL for Slack block notifications. |
webhook_url | string | Optional generic webhook URL for JSON POST notifications. |
set_retention_policy
Set the trace retention policy (how many days to keep traces before archiving). Example: { "retention_days": 30 }
| Parameter | Type | Description |
|---|---|---|
retention_days * | number | Number of days to retain traces before archiving. Must be > 0. |
apply_retention
Apply the current in-process retention policy: archives traces older than retention_days and deletes archived traces past 2× threshold. Call set_retention_policy first. Example: {}
export_compliance_log
Export the compliance audit log as JSON or CSV. Example: { "format": "json" } or { "format": "csv", "from_date": "2025-01-01", "to_date": "2025-12-31" }
| Parameter | Type | Description |
|---|---|---|
format * | string | Output format: "json" or "csv". |
from_date | string | Optional ISO date string to filter entries from (inclusive). |
to_date | string | Optional ISO date string to filter entries to (inclusive). |