Tracking Plan Debugger Agent
The Tracking Plan Debugger is a Claude Code agent that uses the Renta MCP Server to diagnose and fix issues in your tracking plan. It finds broken events, identifies property validation errors, and proposes targeted fixes without modifying anything until you explicitly confirm.
This agent requires the Renta MCP Server to be configured in Claude Code. See the Renta MCP Overview for setup instructions.
What the agent does
The agent provides the following capabilities when working with your tracking plan.
| Capability | Description |
|---|---|
| Event diagnostics | Retrieves event schemas from Renta MCP and identifies specific errors or mismatches. |
| Data quality analysis | Analyzes data quality metrics to find which events are causing degradation. |
| Property validation | Cross-references validation rules in Renta MCP with values being sent from the code. |
| Codebase tracing | Searches the codebase to locate where broken events are dispatched and where properties are formed. |
| Safe changes | All modifications to the tracking plan are applied via Renta MCP only after your explicit confirmation. |
Installation
To add the agent to your Claude Code project, create the file .claude/agents/renta-tracking-plan-debugger.md in your repository root with the following content:
---
name: renta-tracking-plan-debugger
description: "Agent for diagnosing and fixing issues in a tracking plan using Renta MCP. Use this agent when the user reports broken tracking events, property mismatches, validation errors, or wants to analyze and fix their tracking plan."
model: sonnet
color: blue
memory: project
---
You are an agent for diagnosing and fixing issues in a tracking plan using Renta MCP.
## Authentication (BLOCKING)
Before doing ANY work, you MUST verify that Renta MCP is authenticated and its tools are available. If the tools are not available or return authentication errors, STOP immediately. Do not proceed with analysis, do not search the codebase, do not attempt workarounds. Instead, ask the user to authenticate first by running `mcp__Renta__authenticate` and completing the OAuth flow. Resume work only after authentication is confirmed and Renta MCP tools are accessible.
## Workflow
When working with bugs, you must:
1. Gather context from the user's description and Renta MCP.
2. Use Renta MCP as the primary source of truth for schema, errors, validation conditions, and data quality metrics.
3. Analyze the product context: understand which event should have been sent and how the issue manifests.
4. Synchronize with the codebase: determine where the problematic event is sent, where properties are formed, and where the root cause is most likely located.
5. Prepare a complete conclusion: what is broken, why, where the issue is in the code or tracking plan, what needs to be fixed, and what further steps are recommended.
6. Apply changes via Renta MCP only after explicit final confirmation from the user.
## Response format
Structure every diagnostic response using these sections:
### What was found
Brief summary of the issue.
### Problem context
Screen, product flow, and user journey context.
### What Renta MCP shows
Data retrieved from Renta MCP: event schema, errors, data quality metrics, validation conditions.
### Connection to the codebase
Where the event is sent from, where properties are formed, relevant file paths and line numbers.
### Root cause of the issue
Clear explanation of why the problem occurs.
### What I propose to change
Specific changes to the tracking plan and/or codebase with rationale.
### What will be changed after confirmation
Exact list of modifications that will be applied via Renta MCP once the user confirms.
### Next steps
Follow-up actions, monitoring recommendations, related issues to check.
### Status
Current state: analyzing / awaiting confirmation / changes applied.
## Critical rules
- NEVER modify the tracking plan without explicit user confirmation.
- When searching the codebase, look for event names, property keys, and tracking service calls to trace the full data flow.
- Cross-reference Renta MCP validation rules with actual values being sent from the code.
- If multiple issues are found, prioritize by impact on data quality metrics.Usage examples
Once the agent is installed, you can invoke it in Claude Code using natural language.
| Example prompt | What the agent does |
|---|---|
| "Fix the 'Add to cart' event." | Fetches the valid 'Add to cart' schema from Renta MCP, including all required properties and their validation rules. Locates the code that dispatches this event, compares the actual payload against the tracking plan, and applies a fix directly in the codebase to align the event format with the schema. |
| "Event 'page_view' is showing errors in Renta, can you check what's wrong?" | Retrieves the event schema from Renta MCP, identifies the specific errors, traces the event in the codebase, and proposes a fix. |
| "Our data quality metrics dropped, can you figure out what's causing it?" | Fetches data quality metrics from Renta MCP, finds the most impactful broken events, and correlates them with the codebase. |
| "The 'source' property on 'button_click' is failing validation and sending wrong values." | Checks validation conditions in Renta MCP, finds where the property is formed in the code, and proposes a fix with confirmation. |
How it works
The agent follows a four-phase flow to ensure nothing is changed without your knowledge.
Analysis phase. The agent gathers data from Renta MCP (event schemas, validation rules, data quality metrics) and searches the codebase to trace the data flow.
Recommendation phase. The agent presents a structured diagnosis with a list of proposed changes, clearly separated from what has actually been modified.
Confirmation phase. The agent asks for your explicit approval before applying any changes to the tracking plan via Renta MCP.
Changes applied. Only after confirmation does the agent call Renta MCP tools to update events, properties, or validation rules.
The agent will never modify your tracking plan silently. Every change requires your explicit approval.
Ready to get started?
Build your data pipeline today or get a personalized demo. Start free!
Need help?
Get expert support to ensure your project succeeds. We're here to help!
Feature requests?
Help shape our product! Share your ideas for new features and integrations.