mcp-agent-trace-inspector

v1.0.1
io.github.dbsectrainer/mcp-agent-trace-inspector Checked 48 minutes ago Published 27 days ago

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

ParameterTypeDescription
name *stringHuman-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 }

ParameterTypeDescription
input *objectInput payload passed to the tool. Example: { "query": "weather in Paris" }
output *objectOutput/result returned by the tool. Example: { "result": "Sunny, 22°C" }. Add "error" field or "isError": true to flag errors.
tool_name *stringName of the tool or action that was executed. Example: "web_search" or "llm_call"
trace_id *stringID of the trace to record this step under. Example: "abc-123-def-456"
latency_msnumberOptional wall-clock latency of this step in milliseconds. Example: 450
token_countnumberOptional 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" }

ParameterTypeDescription
trace_id *stringID 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" }

ParameterTypeDescription
trace_id *stringID of the trace to summarize. Example: "abc-123-def-456"
modelstringModel 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.

ParameterTypeDescription
limitnumberMaximum 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" }

ParameterTypeDescription
trace_id *stringID 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" }

ParameterTypeDescription
trace_id_a *stringID of the first trace (baseline). Example: "abc-123"
trace_id_b *stringID 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" }

ParameterTypeDescription
trace_id *stringID 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" }

ParameterTypeDescription
format *stringExport format. Currently only "json" is supported.
trace_idstringOptional 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/..." }

ParameterTypeDescription
rules *arrayArray of alert rules to configure.
slack_webhookstringOptional Slack webhook URL for Slack block notifications.
webhook_urlstringOptional 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 }

ParameterTypeDescription
retention_days *numberNumber 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" }

ParameterTypeDescription
format *stringOutput format: "json" or "csv".
from_datestringOptional ISO date string to filter entries from (inclusive).
to_datestringOptional ISO date string to filter entries to (inclusive).