Use observability MCP tools to investigate errors, logs, and traces
Use observability MCP tools to investigate errors, logs, and traces from the LMS backend and other services. This skill teaches the agent how to diagnose problems using structured logging and distributed tracing.
| Tool | Parameters | Description |
|---|---|---|
obs_logs_search | query (LogsQL string), limit (int, default 50) | Search structured logs using LogsQL. Use to find log entries by service, severity, time range, or keywords. |
obs_logs_error_count | service (string, optional), time_range (string, default "1h") | Count error-level log entries for a service over a time window. Quick check for recent errors. |
obs_traces_list | service (string), limit (int, default 20) | List recent traces for a service. Returns trace IDs, span counts, and durations. |
obs_traces_get | trace_id (string) | Fetch a full trace by trace ID. Returns span hierarchy with operation names and durations. |
Perform a full one-shot investigation automatically — do not ask the user for permission between steps:
obs_logs_error_count — get a quick count of recent errors scoped to the LMS backend and a narrow recent window (prefer _time:10m).obs_logs_search — dig into the actual error log entries. Use _time:10m service.name:"Learning Management Service" severity:ERROR. Look for trace_id fields in error records.trace_id in the logs, immediately call obs_traces_get with that trace ID. Do not ask the user whether to do this.obs_logs_error_count — get a quick count of recent errors scoped to the service and time window the user cares about.obs_logs_search — dig into the actual log entries to understand what happened. Look for trace_id fields in error records.obs_traces_get — fetch the full trace to see where the failure occurred in the request flow.Useful LogsQL patterns for this stack:
_time:10m service.name:"Learning Management Service" severity:ERROR
_time:1h severity:ERROR
_time:30m trace_id:"abc123..."
Field names that matter:
service.name — which service emitted the logseverity — log level (ERROR, INFO, DEBUG, etc.)event — structured event name (e.g., db_query, request_completed)trace_id — links logs to tracesUse obs_traces_list when:
Always scope queries to a recent, narrow time window when the user asks about current problems:
_time:10m over _time:1h for "right now" questionsIf multiple traces or log entries are found and the user needs to pick one, use the structured-ui skill to present a choice interface instead of listing them as text.
limit parameter to cap output