# Treblle MCP

> Treblle connects your AI agent to an API observability platform. It lets you send full API request and response payloads directly into a central dashboard for real-time monitoring. You track performance, debug errors, and document endpoints without manual setup. Stop losing context when debugging; get instant visibility into every API call.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** api-monitoring, observability, api-analytics, request-logging, api-documentation

## Description

When your code talks to external services, that conversation generates massive amounts of data—logs, headers, payloads. Sending all that raw traffic manually is a nightmare. This MCP changes that. You connect your agent and it lets you push the entire lifecycle of an API interaction directly into Treblle. Your agent handles sending both the original request and the full response body automatically.

You don't just log; you get observability. As data streams in, Treblle tracks performance metrics and spots errors instantly. Plus, security is built-in: it masks sensitive fields like credit card numbers before anything gets saved. This means your team can focus on debugging and documentation, not worrying about compliance or lost context. When you connect this through Vinkius, you're giving your AI client a single point of truth for all your API traffic.

This is crucial for developers needing a reliable record of what worked, what failed, and how fast it was.

## Tools

### ingest_api_data
Sends a complete set of API request and response data to Treblle, automatically masking any sensitive fields like passwords or credit card numbers.

## Prompt Examples

**Prompt:** 
```
Ingest this API request and response data into Treblle: { "server": { ... }, "request": { ... }, "response": { ... } }
```

**Response:** 
```
I've successfully ingested the API data into Treblle. You can now view the request details, performance metrics, and documentation in your Treblle dashboard.
```

**Prompt:** 
```
Send this API error payload to Treblle with metadata trace-id 'abc-123'.
```

**Response:** 
```
The error payload has been sent to Treblle and tagged with trace-id 'abc-123'. It will appear in your error logs for further investigation.
```

**Prompt:** 
```
Log a successful GET request to /users into Treblle using the ingest_api_data tool.
```

**Response:** 
```
I've logged the GET /users request to Treblle. The traffic data has been processed and is now available for monitoring.
```

## Capabilities

### Log Full Request/Response Payloads
Send the entire raw body of an API interaction—both the request sent out and the response received back—to Treblle.

### Mask Sensitive Data Automatically
Treblle automatically scrubs private information, like passwords or SSNs, from the data before logging it, keeping your system secure.

### Attach Custom Context IDs
Add specific identifiers, such as user IDs or trace IDs, to log entries so you can filter and group related calls later.

### Monitor Live API Performance
Observe API health and traffic patterns in real time as your agent runs tests or processes live data.

## Use Cases

### Debugging a Payment Failure
A QA Engineer runs a payment test and gets a generic '500 Internal Server Error.' Instead of manually copying headers, they ask their agent to run the transaction and log it with `ingest_api_data`. Treblle captures the full response payload, revealing that the failure was due to an outdated card token, not a server issue.

### Auditing API Changes
A Backend Developer needs to prove what data was exchanged between services last week. They use their agent to run targeted read operations and log them via `ingest_api_data`. Treblle provides a historical, auditable record of every successful call.

### Troubleshooting Slow Endpoints
A DevOps team notices the `/user/details` endpoint is running slowly. They run diagnostic calls and log them to Treblle. By viewing the real-time performance metrics in the dashboard, they pinpoint that a specific database query within the response body is causing the bottleneck.

### Building API Documentation
A new team member needs to understand an undocumented endpoint. They run several test calls and use `ingest_api_data` to log them. Treblle processes this stream of data, creating a clean, documented view of the request/response structure for future developers.

## Benefits

- Stop guessing why an API failed. By using the `ingest_api_data` tool, you get full request and response payloads, allowing your agent to show you exactly where the breakdown happened.
- Security is handled automatically. Treblle masks sensitive fields like SSNs and credit card numbers before logging anything. You gain observability without sacrificing compliance.
- Build better documentation faster. Every time you log a successful call using this MCP, you are building out a detailed record of that endpoint's expected behavior.
- Improve debugging cycles dramatically. Instead of relying on fragmented terminal outputs, you can trace complex error flows and performance metrics right inside Treblle.
- Context is king. You can attach custom metadata like user IDs or environment names to every log entry, making it simple to filter thousands of calls down to the exact interaction you need.

## How It Works

The bottom line is that your agent handles all the messy logging details; you just get clean, actionable observability data.

1. First, subscribe to this MCP and provide Treblle with your required API Key and SDK Token.
2. Next, tell your AI client to send the full payload (request body + response body) using the `ingest_api_data` tool.
3. Finally, the data appears in your Treblle dashboard, where you can view performance metrics, check for errors, and access masked logs.

## Frequently Asked Questions

**How do I use Treblle MCP to document my existing APIs?**
You repeatedly run test calls through your agent using the `ingest_api_data` tool. Treblle ingests these successful interactions, automatically building out a comprehensive record of the endpoint's inputs and outputs for documentation.

**Does Treblle MCP mask sensitive data?**
Yes, it does. The `ingest_api_data` tool includes built-in security features that automatically detect and mask private fields like credit card numbers or passwords before they are stored.

**Is Treblle MCP only for debugging errors?**
No, it's for full observability. While excellent for error tracking, you should also use it to log successful calls to monitor performance and build documentation.

**What data does `ingest_api_data` require?**
It requires the full request payload (what was sent) and the full response payload (what came back). Sending both gives you complete context for analysis in Treblle.

**Can I add custom labels to my API logs using Treblle MCP?**
Yes. You can attach specific metadata, like unique user IDs or trace numbers, to every log entry. This allows you to filter huge amounts of data down to a very specific set of calls.