# AgentOps MCP

> AgentOps tracks performance data for your AI agents. It lets you inspect how agentic workflows perform by retrieving execution traces, analyzing specific spans, and monitoring token costs in real time.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** telemetry, observability, ai-agents, tracing, monitoring

## Description

When building complex AI agents, knowing what's happening under the hood is critical. This MCP gives you deep visibility into the entire lifecycle of an agent run. Instead of just getting a final answer, your agent provides data detailing every step it took, including which tools it called and how much compute power that cost. You can inspect specific execution traces to understand decision points or find where slowdowns happen. It also tracks token usage across all interactions, helping you manage costs before they get out of hand. Connecting this MCP via Vinkius allows your agent to report its operational metrics directly through any compatible client.

## Tools

### get_trace
Retrieves the complete record and sequence for a specific, full agent run.

### get_project
Retrieves basic configuration details for the AgentOps monitoring project.

### get_span
Gets detailed information about a single segment of an agent's execution path.

### get_trace_metrics
Calculates metrics like token count and cost associated with a specific recorded trace.

## Prompt Examples

**Prompt:** 
```
Get the details for my current AgentOps project.
```

**Response:** 
```
I've retrieved your project details. Your current project is 'Production-Agent-v2' (ID: ao_proj_882). It is currently active and receiving telemetry data.
```

**Prompt:** 
```
Show me the metrics and token costs for trace ID trace_abc123.
```

**Response:** 
```
For trace trace_abc123, the total token count was 1,450 (800 prompt, 650 completion) with an estimated cost of $0.028. The execution took 4.2 seconds across 5 spans.
```

**Prompt:** 
```
Inspect the details of span ID span_998877.
```

**Response:** 
```
Span span_998877 was a 'tool_call' to 'web_search'. It started at 10:05:02 and finished at 10:05:04. Input parameters included 'query: agent observability' and it returned 3 search results.
```

## Capabilities

### Review project metadata
Retrieves high-level status information for the entire AgentOps monitoring project.

### Analyze full execution paths
Inspects complete agent runs (traces) to map out decision flow and sequence of events.

### Calculate performance costs
Provides detailed metrics for a specific trace, including token usage counts and associated monetary cost.

### Debug individual steps
Drills down into single spans within a trace to examine tool inputs or LLM interactions precisely.

## Use Cases

### Agent fails on external tool call
A user asks the agent to search for a flight, but it fails. Instead of just seeing 'Error,' you use `get_trace` to see that the failure occurred in the final span and that the input parameters sent were malformed.

### Unexpectedly high API costs
The agent works great, but the bill is too high. You run `get_trace_metrics` on a sample successful run to determine if 80% of your cost comes from prompt tokens or completion tokens.

### Debugging multi-step reasoning
The agent's answer is wrong, but you can't tell why. You use `get_span` to examine the intermediate steps—the raw decision points—to see where the model misinterpreted the initial data.

## Benefits

- Pinpoint failures instantly. When an agent fails, you use `get_trace` to see the full sequence of calls, knowing exactly where the logic broke down.
- Control your budget. Use `get_trace_metrics` before deployment to estimate and track token consumption for specific workflows.
- Debug deep issues. If a step is slow, don't guess. Use `get_span` to zoom in on that single interaction and see the raw input/output parameters.
- Understand scope. Before writing code, run `get_project` to confirm which monitoring project you are currently connected to.
- Maintain reliability. By collecting structured data via this MCP, your agents become auditable components of your larger system.

## How It Works

The bottom line is you get a clean, structured stream of operational data about your agents' behavior.

1. First, subscribe to this MCP and input your AgentOps API key.
2. Next, run an agent workflow that generates telemetry data you want to monitor.
3. Finally, use the relevant tool—for instance, running `get_trace`—to pull structured metrics detailing performance and costs.

## Frequently Asked Questions

**How do I check my agent's current monitoring project details using get_project?**
You call `get_project` to retrieve the high-level metadata for your AgentOps setup. This confirms which environment and API key are active, ensuring you’re looking at the correct data set.

**What is the difference between get_trace and get_span?**
A trace (`get_trace`) gives you the full picture of an entire run. A span (`get_span`) lets you drill down into one small, specific segment within that larger run for deep inspection.

**Can I track token usage with get_trace_metrics?**
Yes, `get_trace_metrics` provides detailed data on token counts for both prompt and completion segments. This lets you calculate the exact cost associated with any given workflow.

**Is AgentOps good for multi-agent systems?**
Absolutely. The MCP is designed to capture complex, sequential interactions common in multi-agent setups, allowing you to monitor how agents pass information between each other.

**When debugging a workflow failure, what specific information can I get using get_span?**
get_span gives you granular details about one specific action within the agent's run. You see exactly what parameters were used for tool calls or LLM interactions, and precisely when that step started and finished. This helps pinpoint whether a failure came from bad input data or an unexpected external service response.

**How do I check my AgentOps project status using get_project before running complex jobs?**
You use get_project to verify your connection and retrieve high-level details about your current monitoring setup. This ensures your API key is linked to the correct, active project ID. It's a quick way to confirm you're looking at the right data source before deep debugging.

**Are there limitations on how much data I can pull with get_trace for very long workflows?**
While we handle large datasets, repeatedly running get_trace on massive traces might hit rate limits. For the best performance when analyzing complex runs, it's better to first use get_project to scope your search, or break down the investigation using smaller, targeted calls with get_span.

**Beyond token costs, what specific timing metrics does get_trace_metrics provide?**
get_trace_metrics provides critical time-based data. You can see the total execution duration for a trace, as well as how long individual spans took to complete. This lets you determine if latency is caused by the model itself or by external API calls.

**How can I check the token usage and cost for a specific agent execution?**
You can use the `get_trace_metrics` tool by providing the specific Trace ID. It will return detailed data on token counts and the calculated financial cost for that execution.

**Can I see the details of a single step within a larger trace?**
Yes! Use the `get_span` tool with the specific Span ID. This allows you to isolate and inspect individual operations, such as a single tool call or a specific LLM completion.

**How do I verify which AgentOps project is currently active?**
Simply run the `get_project` tool. It retrieves the metadata and configuration details of the project associated with your current API key.