{"slug":"monte-carlo-troubleshoot-agent-traces","title":"monte-carlo-troubleshoot-agent-traces","summary":"Troubleshoots Monte Carlo AI agent alerts and traces — eval score drops, latency/token spikes, trajectory and validation breaches. Not for data incidents (monte-carlo-analyze-root-cause) or monitor creation (monte-carlo-monitoring-advisor).","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-20T07:56:54.157762Z","repo":{"url":"https://github.com/monte-carlo-data/mc-agent-toolkit","stars":93,"forks":5,"license":"Apache-2.0","updatedAt":"2026-11-10T16:19:12Z"},"bodyHtml":"<h1>Troubleshoot Agent Traces Skill</h1>\n<p>Investigate Monte Carlo AI agent alerts and traces — evaluation score drops, latency and token spikes, trajectory violations, and validation breaches. Classifies the alert, routes to the right playbook for the agent's backend, and guides a systematic trace investigation while Monte Carlo's trace troubleshooting agent (TTSA) runs in parallel.</p>\n<h2>What it does</h2>\n<ul>\n<li>Classifies an alert server-side: is it an agent alert, which shape (evaluation / metric / trajectory / validation), and which backend the agent's traces live in</li>\n<li>Routes the investigation with two files: an alert-shape playbook (WHAT to investigate) plus a backend guide (HOW, and what signal exists there)</li>\n<li>Kicks off the trace troubleshooting agent (TTSA) automatically for agent alerts and merges its findings with the manual investigation</li>\n<li>Investigates traces, conversations, and segments — grounding the alert window against a baseline to find what changed and when</li>\n<li>Handles trace-first intake too: a trace ID, conversation ID, or plain problem description with no alert</li>\n<li>Hands off non-agent alerts to the analyze-root-cause skill</li>\n<li>Presents a findings timeline with per-item confidence levels and a recommended fix in the backend's fix language</li>\n</ul>\n<h2>MCP Tools Required</h2>\n<p>Connect to Monte Carlo's MCP server (<code>integrations.getmontecarlo.com/mcp</code>). The skill uses these tools:</p>\n<table>\n<thead>\n<tr>\n<th>Tool</th>\n<th>Purpose</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>get_alerts</code></td>\n<td>Fetch alert details; list recent alerts (agent alert categories in <code>alert_types</code>)</td>\n</tr>\n<tr>\n<td><code>get_alert_agent_classification</code></td>\n<td>Classify one alert: agent or not, alert shape, and the agent's backend class</td>\n</tr>\n<tr>\n<td><code>alert_assessment</code></td>\n<td>Optional ~2-min triage of an alert (HIGH/MEDIUM/LOW confidence + impact)</td>\n</tr>\n<tr>\n<td><code>get_agent_metadata</code></td>\n<td>List AI agents — names, trace tables, backend classes, source types, warehouses</td>\n</tr>\n<tr>\n<td><code>get_agent_traces</code></td>\n<td>List traces with workflows, tasks, models, tokens, duration, error counts</td>\n</tr>\n<tr>\n<td><code>get_agent_trace</code></td>\n<td>Inspect one execution trace's full span tree (managed OTel store agents only — errors on other backends)</td>\n</tr>\n<tr>\n<td><code>get_agent_conversations</code></td>\n<td>List recent conversations for an agent (filterable)</td>\n</tr>\n<tr>\n<td><code>get_agent_conversation</code></td>\n<td>One conversation's full prompt/completion thread</td>\n</tr>\n<tr>\n<td><code>get_agent_segments</code></td>\n<td>Distinct workflow / task / model values for segment isolation</td>\n</tr>\n<tr>\n<td><code>run_troubleshooting_agent</code></td>\n<td>Starts the Troubleshooting Agent; for agent alerts it automatically runs the trace troubleshooting agent (TTSA). Auto-invoked when an incident UUID is present</td>\n</tr>\n<tr>\n<td><code>get_troubleshooting_agent_results</code></td>\n<td>Polls TTSA results for an alert</td>\n</tr>\n</tbody>\n</table>\n<blockquote>\n<p><strong>Credits:</strong> <code>alert_assessment</code> and <code>run_troubleshooting_agent</code> consume Monte Carlo credits the same way the Troubleshooting Agent does when launched from the Monte Carlo UI. Each fresh <code>run_troubleshooting_agent</code> call is a billable run; reuse via the built-in idempotency (don't pass <code>force_rerun=True</code> unless the user explicitly asks for a fresh analysis).</p>\n</blockquote>\n<p><strong>Note:</strong> this skill depends on the <code>get_alert_agent_classification</code> tool, which ships with ai-agent PR #1745. On Monte Carlo MCP servers that predate it, the skill says so and falls back to asking the user which alert type fired and which platform hosts the agent.</p>\n<h2>Example prompts</h2>\n<ul>\n<li>\"Investigate this agent alert\"</li>\n<li>\"Why did my agent's eval score drop yesterday?\"</li>\n<li>\"Troubleshoot trace 3f2a91c0\"</li>\n<li>\"My agent is failing — what's going on?\"</li>\n<li>\"My agent got slow this week, can you look into it?\"</li>\n</ul>\n<h2>Investigation flow</h2>\n<pre><code>Intake (alert UUID / alert URL, or trace ID / conversation ID / description)\n    ↓\nAuto-invoke TTSA (if incident UUID + not opt-out)                     ─┐\n    ↓                                                                  │\nClassify the alert (agent or not / alert shape / backend class)        │ TTSA runs\n    ↓                                                                  │ async in\nRoute: alert-shape playbook + backend guide (ALWAYS both)              │ parallel\n    ↓                                                                  │\nInvestigate: breaching traces → baseline →           ── poll TTSA #1 ──┤\nonset → correlated change                                              │\n    ↓                                                                  │\nSynthesize: findings timeline + fix + verification   ── poll TTSA #2 ──┘\n                                                       + merge findings\n</code></pre>\n<p>When intake has no incident UUID (a trace ID, conversation ID, or plain description), or the user explicitly opts out (\"skip the troubleshooting agent\", \"manual only\"), TTSA is skipped and the manual flow runs alone. Alerts that classify as non-agent hand off to the monte-carlo-analyze-root-cause skill.</p>\n<h2>Reference files</h2>\n<table>\n<thead>\n<tr>\n<th>File</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>references/agent-alert-evaluation.md</code></td>\n<td>Agent evaluation breach playbook (LLM-judged quality scores)</td>\n</tr>\n<tr>\n<td><code>references/agent-alert-metric.md</code></td>\n<td>Agent metric breach playbook (latency, tokens, error rate)</td>\n</tr>\n<tr>\n<td><code>references/agent-alert-trajectory.md</code></td>\n<td>Agent trajectory breach playbook (execution-shape assertions)</td>\n</tr>\n<tr>\n<td><code>references/agent-alert-validation.md</code></td>\n<td>Agent validation breach playbook (span-level assertions)</td>\n</tr>\n<tr>\n<td><code>references/agent-direct-trace.md</code></td>\n<td>Intake without an alert — trace ID, conversation ID, or description</td>\n</tr>\n<tr>\n<td><code>references/agent-backend-clickhouse.md</code></td>\n<td>Monte Carlo-managed trace store (<code>ao_clickhouse_otel</code>)</td>\n</tr>\n<tr>\n<td><code>references/agent-backend-cortex.md</code></td>\n<td>Snowflake Cortex agents (<code>platform_agent</code>)</td>\n</tr>\n<tr>\n<td><code>references/agent-backend-genie.md</code></td>\n<td>Databricks Genie spaces (<code>databricks_genie</code>)</td>\n</tr>\n<tr>\n<td><code>references/agent-backend-customer-otel.md</code></td>\n<td>Customer-managed OpenTelemetry trace table (<code>customer_otel_trace_table</code>)</td>\n</tr>\n<tr>\n<td><code>references/agent-backend-mlflow-sdk.md</code></td>\n<td>Databricks MLflow SDK agents (<code>databricks_mlflow_sdk</code>)</td>\n</tr>\n<tr>\n<td><code>references/agent-backend-mlflow-ka.md</code></td>\n<td>Databricks Knowledge Assistants (<code>databricks_mlflow_ka</code>)</td>\n</tr>\n</tbody>\n</table>\n","files":[{"path":"README.md","sizeBytes":5964,"isText":true},{"path":"references/agent-alert-evaluation.md","sizeBytes":9232,"isText":true},{"path":"references/agent-alert-metric.md","sizeBytes":6222,"isText":true},{"path":"references/agent-alert-trajectory.md","sizeBytes":6249,"isText":true},{"path":"references/agent-alert-validation.md","sizeBytes":6105,"isText":true},{"path":"references/agent-backend-clickhouse.md","sizeBytes":6727,"isText":true},{"path":"references/agent-backend-cortex.md","sizeBytes":6094,"isText":true},{"path":"references/agent-backend-customer-otel.md","sizeBytes":5351,"isText":true},{"path":"references/agent-backend-genie.md","sizeBytes":6497,"isText":true},{"path":"references/agent-backend-mlflow-ka.md","sizeBytes":5403,"isText":true},{"path":"references/agent-backend-mlflow-sdk.md","sizeBytes":5167,"isText":true},{"path":"references/agent-direct-trace.md","sizeBytes":5767,"isText":true},{"path":"SKILL.md","sizeBytes":17402,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-20T07:57:31.131859Z","sha256":"6B7B9A043596912B9E5BD857C23C2FFA799D5412B43729682A6EBDD42D00FF1E","sizeBytes":40619},"review":null,"source":{"repositoryUrl":"https://github.com/monte-carlo-data/mc-agent-toolkit","path":"skills/troubleshoot-agent-traces","license":"Apache-2.0","commit":"183134b90e33b5016818081daadbf9d554db17e7","subtreeSha":"4EC82150E10DEE8A1F086FCEC633DF30CADC3ED4CAECED9186A4F015C9C43FF0","lastSyncedAt":"2026-11-10T21:44:45.803666Z"},"reviewedAt":"2026-09-20T07:58:50.371085Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/monte-carlo-data/mc-agent-toolkit/tree/main/skills/troubleshoot-agent-traces"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install monte-carlo-data-mc-agent-toolkit@llmmart"},{"target":"git","command":"git clone https://github.com/monte-carlo-data/mc-agent-toolkit.git"}]}