# Deep Diff Engine MCP for AI Agents AI Agent Connect

> Deep Diff Engine finds every single change between two JSON objects or arrays. It identifies additions, deletions, and edits while providing the exact structural path for each change. Stop asking your agent to 'spot the difference' and get machine-readable edit paths instead.

## Overview
- **Category:** utilities
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_O5wa4YabuE6ETZnARIxqA2hgMHDub30xihBar1fa/ai-agent-connect
- **Tags:** json, diff, compare, structural, validation

## Description

You're looking at two Kubernetes configs, and your AI client tells you the replica count changed. It completely missed the fact that a critical security label was wiped out three levels deep in the spec. That's a massive risk because the AI is just glancing at the text, not the actual data structure. This Connector fixes that by using a battle-tested engine to map out every single change between two JSON files. It doesn't care about whitespace or formatting; it only cares about the real data.

When you run a diff, you get the exact property path, like spec.template.metadata.labels.env, so you know exactly where to apply a patch. This is a huge upgrade for anyone managing complex configs or auditing security policies where a single missing key can break your production environment. You can find this tool in the Vinkius catalog to give your agent the precision it needs to handle production-grade JSON data without the guesswork. It turns a vague summary into a precise map of changes.

## Tools

### calculate_json_diff
Compares two JSON objects and returns a list of additions, edits, and deletions with their exact paths.

## Prompt Examples

**Prompt:** 
```
Compare these two Kubernetes manifests and tell me what's different.
```

**Response:** 
```
Comparison complete. 3 changes found:

* **Edit**: `spec.replicas` (Value changed from 3 to 5)
* **Addition**: `spec.template.spec.node_selector` (New key added)
* **Deletion**: `metadata.labels.old_label` (Key removed)

All changes were identified via structural diffing.
```

**Prompt:** 
```
I'm worried about this IAM policy change. What permissions were added?
```

**Response:** 
```
The `calculate_json_diff` tool identified 2 new permissions added to the 'Action' array:

* `s3:PutObject`
* `s3:DeleteObject` 

Both were added to `Statement[0].Action`. No other structural changes were detected.
```

**Prompt:** 
```
Are these two API responses the same structure?
```

**Response:** 
```
Yes. I compared both payloads and found 0 structural differences. The keys and nested arrays are identical, though the values differ. You can proceed with the integration.
```

## Capabilities

### Get exact property paths
See the precise location of every change in a nested object.

### Classify change types
Identify if a value was added, deleted, or edited.

### Map deep array changes
Detect exactly which items were modified inside nested lists.

### Ignore formatting noise
Focus only on data changes by skipping whitespace and indentation.

### Generate patch paths
Receive machine-readable paths to help your agent create accurate fix files.

## Use Cases

### Kubernetes Config Audit
A DevOps engineer asks the agent to find differences between staging and production manifests to catch configuration drift.

### IAM Policy Review
A security pro wants to see what permissions were added in a 500-line IAM policy JSON during a recent migration.

### API Response Validation
A developer checks if a new backend release changed the structure of a nested JSON response for a mobile app.

### Configuration Drift Detection
An SRE uses the tool to find discrepancies between a local config file and a remote state file for a production cluster.

## Benefits

- Stop guessing about changes: Use calculate_json_diff to see exactly what moved, was added, or was deleted in a JSON file.
- Get precise edit paths: Instead of a general summary, you get the exact property path for every change in a nested object.
- Audit security policies: Quickly identify if a critical permission was removed or added in complex IAM JSON structures.
- Validate production configs: Ensure your Kubernetes specs are identical across environments by checking structural fidelity.
- Automate patch generation: Use the machine-readable paths from the diff to have your agent create accurate configuration fixes.

## How It Works

The bottom line is you get a precise map of data changes instead of a vague summary.

1. Provide two JSON objects or arrays to your agent.
2. The agent calls the Connector to compare the structures.
3. You get a list of specific changes with their exact paths.

## Frequently Asked Questions

**Can Deep Diff Engine compare Kubernetes files?**
Yes. It is perfect for comparing two JSON-formatted Kubernetes manifests to find discrepancies in labels, specs, or metadata.

**Does Deep Diff Engine handle nested arrays?**
Yes. It detects when items are added, removed, or changed inside deep nested arrays, not just top-level keys.

**Will Deep Diff Engine show me whitespace changes?**
No. It ignores formatting and whitespace, focusing only on actual data changes to keep your results clean.

**Can I use Deep Diff Engine to find security leaks?**
It helps you audit security by highlighting exactly which permissions were added or deleted in a JSON policy.

**Does Deep Diff Engine work on any JSON?**
Yes. It works on any valid JSON object or array, making it useful for API responses, config files, and more.

**How do I get the exact path of a change?**
The tool returns the full property path, like `metadata.annotations.version`, so you know exactly where to apply a fix.

**Why shouldn't I just use string comparison?**
String comparison fails if the keys are reordered (e.g., `{"a":1,"b":2}` vs `{"b":2,"a":1}`). This engine understands JSON structure, so it correctly identifies that reordered keys are not semantic changes.

**What do the 'kind' letters mean in the output?**
'N' means a newly added property. 'D' means a deleted property. 'E' means an edited/changed property. 'A' means a change occurred within an array.

**Can this be used for config drift detection?**
Absolutely. Agents can fetch the desired state from Git, fetch the actual state from the live API, and use this engine to generate a list of exact properties that have drifted.