tracehub-mcp

v0.13.2
io.github.mcpsmiths/tracehub-mcp Checked 4 days ago Published 19 days ago

Query OTel traces across Jaeger, Tempo, Traceloop, Datadog, Sentry, X-Ray, New Relic, Honeycomb.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_traces Search Traces

Search for OpenTelemetry traces with filters. Supports both simple parameters and advanced generic filter system.

ParameterTypeDescription
end_timeEnd time in ISO 8601 format
filtersGeneric filter conditions (advanced) - list of filter objects with: - field: Field name in dotted notation (e.g., "gen_ai.usage.prompt_tokens") - operator: Comparison operator (equals, not_equals, gt,…
gen_ai_request_modelFilter by requested model name (e.g., gpt-4)
gen_ai_response_modelFilter by actual model used (e.g., gpt-4-0613)
gen_ai_systemFilter by LLM provider (e.g., openai, anthropic)
has_errorFilter traces with errors
limitintegerMaximum number of traces to return (1-1000, default: 100)
max_duration_msMaximum trace duration in milliseconds
min_duration_msMinimum trace duration in milliseconds
operation_nameFilter by operation/span name
service_nameFilter by service name (use filters for advanced queries)
start_timeStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)
tagsAdditional tag filters as key-value pairs

get_trace Get Trace

Get complete trace details by trace ID. Returns all spans with attributes, including parsed Opentelemetry data for LLM operations.

ParameterTypeDescription
trace_id *stringTrace identifier
detail_levelstring"full" (default) returns every attribute/event value in full, unchanged from this tool's original behavior. "summary" elides known-large gen_ai.* fields (input/output messages, system instructions, re…

triage_trace Triage Trace

Synthesize a likely-root-cause diagnosis for a trace, instead of returning raw trace data for the caller to re-derive one from every time. Computes a critical path (the "Last Finishing Child" chain actually responsible for the trace's total latency), ranks spans by self-time (latency contribution net of children, top 10), and - when the trace contains an error anywhere under any root span - identifies the deepest error span in the trace's error chain as the likely root cause. Falls back to the highest self-time span as a pure-latency diagnosis when no error is present. Deterministic (no LLM c…

ParameterTypeDescription
trace_id *stringTrace identifier
detail_levelstring"summary" (default) returns a compact diagnosis only - this differs from get_trace's own "full"-by-default, since a triage result is already a small synthesized diagnosis rather than a raw data dump,…

correlate_trace Correlate Trace

Try to find the corresponding trace in a second, independently- configured backend (e.g. a Datadog trace and its downstream Sentry error, joined) - given a trace_id known to the primary backend. Tries a direct trace_id match in the secondary backend first (confidence "high"); if that fails, falls back to a time-window + service-name-overlap heuristic search (confidence "low"). This is a best-effort correlation, not a guaranteed join - see the always-present `limitations` in the result for why. Requires a secondary backend to be configured via SECONDARY_BACKEND_TYPE/SECONDARY_BACKEND_URL (and…

ParameterTypeDescription
trace_id *stringTrace identifier, as known to the primary (already configured) backend.

get_llm_usage Get LLM Usage

Get aggregated LLM usage metrics (token counts) for a time period. Provides breakdowns by model and service.

ParameterTypeDescription
end_timeEnd time in ISO 8601 format
gen_ai_request_modelFilter by requested model name
gen_ai_response_modelFilter by actual model used
gen_ai_systemFilter by LLM provider
limitintegerMaximum traces to analyze (default: 1000)
service_nameFilter by service name
start_timeStart time in ISO 8601 format

list_services List Services

List all available services in the OpenTelemetry backend. Returns: JSON string with list of services

find_errors Find Errors

Find traces with errors. Including detailed error messages, stack traces, and LLM-specific error information.

ParameterTypeDescription
end_timeEnd time in ISO 8601 format
limitintegerMaximum error traces to return (default: 100)
service_nameFilter by service name
start_timeStart time in ISO 8601 format

list_llm_models List LLM Models

List all LLM models being used with usage statistics. Discovers what models are deployed and tracks their usage patterns.

ParameterTypeDescription
end_timeEnd time in ISO 8601 format
gen_ai_systemFilter by LLM provider (e.g., openai, anthropic, cohere)
limitintegerMaximum traces to analyze for model discovery (default: 1000)
service_nameFilter by service name
start_timeStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)

get_llm_model_stats Get LLM Model Stats

Get detailed performance statistics for a specific LLM model. Analyzes request count, latency percentiles (p50, p95, p99), token usage statistics, error rates, and finish reason distributions.

ParameterTypeDescription
model_name *stringModel name to analyze (e.g., "gpt-4", "claude-3-opus", "gpt-3.5-turbo")
end_timeEnd time in ISO 8601 format
limitintegerMaximum traces to analyze (default: 1000, capped by MAX_TRACES_PER_QUERY / --max-traces-per-query)
service_nameFilter by service name
start_timeStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)

list_sessions List Sessions

List conversations/sessions grouped by gen_ai.conversation.id. Groups spans that carry the gen_ai.conversation.id attribute (a real, cross-industry OTel semantic convention for session/conversation grouping) to surface per-conversation span counts, token usage, and time bounds - useful for understanding multi-turn conversation activity.

ParameterTypeDescription
end_timeEnd time in ISO 8601 format
gen_ai_systemFilter by LLM provider (openai, anthropic, etc.)
limitintegerMaximum spans to analyze (default: 1000)
service_nameFilter by service name
start_timeStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)

get_session_stats Get Session Stats

Get detailed statistics for a single conversation/session. Analyzes span count, distinct services, time bounds, LLM request/success/ error counts, latency percentiles, and token usage for every span sharing the given gen_ai.conversation.id.

ParameterTypeDescription
conversation_id *stringThe gen_ai.conversation.id to analyze
end_timeEnd time in ISO 8601 format
limitintegerMaximum spans to analyze (default: 1000)
service_nameFilter by service name
start_timeStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)

compare_time_windows Compare Time Windows

Compare aggregated LLM usage metrics between two time windows. Runs the same usage aggregation for both ranges and returns the delta - useful for "this week vs last week" or "before/after a deploy" style comparisons of request/token counts.

ParameterTypeDescription
gen_ai_request_modelFilter by requested model name (applied to both ranges)
gen_ai_response_modelFilter by actual model used (applied to both ranges)
gen_ai_systemFilter by LLM provider (applied to both ranges)
limitintegerMaximum number of traces to analyze per range (default: 1000)
range_a_endRange A end time in ISO 8601 format
range_a_startRange A start time in ISO 8601 format
range_b_endRange B end time in ISO 8601 format
range_b_startRange B start time in ISO 8601 format
service_nameFilter by service name (applied to both ranges)

investigate_cost_spike Investigate Cost Spike

Investigate an LLM cost spike: compare a recent window against a baseline and rank which models/services contributed most to the change. On-request/pull-based analysis, not a push alert - mirrors SigNoz's own "investigate telemetry cost" skill. Call this when you suspect (or want to check for) a cost increase, rather than polling get_llm_usage by hand.

ParameterTypeDescription
recent_end *stringRecent window end time in ISO 8601 format
recent_start *stringRecent window start time in ISO 8601 format
baseline_endBaseline window end (ISO 8601)
baseline_startBaseline window start (ISO 8601). If omitted along with baseline_end, auto-computed as the same duration immediately preceding recent_start.
gen_ai_request_modelFilter by requested model name (applied to both windows)
gen_ai_response_modelFilter by actual model used (applied to both windows)
gen_ai_systemFilter by LLM provider (applied to both windows)
limitintegerMaximum number of traces to analyze per window (default: 1000)
service_nameFilter by service name (applied to both windows)
top_nintegerMaximum ranked contributors to return per breakdown (default: 5, max: 50)

investigate_error_spike Investigate Error Spike

Investigate an error-rate spike: compare a recent window against a baseline and rank which services/models/error types contributed most. is_spike requires both an absolute error-count floor and a relative rate-multiplier to hold, so a tiny sample (e.g. 1 error becoming 2) doesn't read as a spike.

ParameterTypeDescription
recent_end *stringRecent window end time in ISO 8601 format
recent_start *stringRecent window start time in ISO 8601 format
baseline_endBaseline window end (ISO 8601)
baseline_startBaseline window start (ISO 8601). If omitted along with baseline_end, auto-computed as the same duration immediately preceding recent_start.
limitintegerMaximum number of traces to analyze per window (default: 1000)
min_error_count_increaseintegerMinimum absolute error-count increase to count as a spike (default: 3)
rate_multiplier_thresholdnumberMinimum error-rate multiplier (recent / baseline) to count as a spike (default: 2.0)
service_nameFilter by service name (applied to both windows)
top_nintegerMaximum ranked contributors to return per breakdown (default: 5, max: 50)

get_prompt_version_stats Get Prompt Version Stats

Get aggregated performance stats grouped by prompt name and version. Groups spans by gen_ai.prompt.name + gen_ai.prompt.version, mirroring Langfuse's shipped per-prompt Metrics tab. Real-world adoption of these two attributes is still thin, so this tool may often return an empty list until more instrumentations populate them.

ParameterTypeDescription
end_timeEnd time in ISO 8601 format
gen_ai_systemFilter by LLM provider (openai, anthropic, etc.)
limitintegerMaximum spans to analyze (default: 1000)
service_nameFilter by service name
start_timeStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)

get_llm_expensive_traces Get LLM Expensive Traces

Find traces with highest LLM token usage. Useful for cost optimization and identifying inefficient prompts.

ParameterTypeDescription
end_timeEnd time in ISO 8601 format
gen_ai_request_modelFilter by requested model name (e.g., "gpt-4")
gen_ai_response_modelFilter by actual model used (e.g., "gpt-4-0613")
limitintegerMaximum number of traces to return (default: 10)
min_tokensMinimum token count threshold (only return traces above this)
service_nameFilter by service name
start_timeStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)

get_llm_slow_traces Get LLM Slow Traces

Find slowest LLM traces by duration. Useful for performance optimization and identifying latency bottlenecks.

ParameterTypeDescription
end_timeEnd time in ISO 8601 format
gen_ai_request_modelFilter by requested model name (e.g., "gpt-4")
gen_ai_response_modelFilter by actual model used (e.g., "gpt-4-0613")
limitintegerMaximum number of traces to return (default: 10)
min_duration_msMinimum duration threshold in milliseconds (only return traces above this)
service_nameFilter by service name
start_timeStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)

search_spans_tool Search Spans

Search for individual OpenTelemetry spans with optional filters. Unlike search_traces, this returns individual spans rather than grouped traces, which is useful for analyzing specific operations or finding spans with certain characteristics (e.g., LLM tool calls with traceloop.span.kind == tool).

ParameterTypeDescription
end_timeEnd time in ISO 8601 format
filtersGeneric filter conditions - list of filter objects with: - field: Field name in dotted notation (e.g., "traceloop.span.kind") - operator: Comparison operator - value: Single value for most operators -…
gen_ai_request_modelFilter by requested model name (e.g., "gpt-4")
gen_ai_response_modelFilter by actual model used (e.g., "gpt-4-0613")
gen_ai_systemFilter by LLM provider (e.g., openai, anthropic)
has_errorFilter spans with errors
limitintegerMaximum number of spans to return (1-1000, default: 100)
max_duration_msMaximum span duration in milliseconds
min_duration_msMinimum span duration in milliseconds
operation_nameFilter by operation/span name
service_nameFilter by service name
start_timeStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)
tagsAdditional tag filters as key-value pairs

list_llm_tools_tool List LLM Tools

List all LLM tools being used by identifying traceloop.span.kind == tool. Discovers which tools/functions LLM applications are calling, grouped by tool name with usage statistics.

ParameterTypeDescription
end_timeEnd time in ISO 8601 format
gen_ai_systemFilter by LLM provider (openai, anthropic, etc.)
limitintegerMaximum spans to analyze (default: 1000)
service_nameFilter by service name
start_timeStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)