# Distance Matrix Completeness Auditor AI Agent Connect

> Distance Matrix Completeness Auditor is a specialized tool for validating the integrity of logistics and routing matrices. It catches missing data, mathematical inconsistencies, and structural flaws that break optimization models. Your AI client uses it to scan for dimension mismatches, negative values, or symmetry issues, ensuring your travel-time data is actually usable for planning.

## Overview
- **Category:** logistics
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_IRGJcLjOWRza5HvCtnVbwxz6b0aGBTHuO5ZETSLC/ai-agent-connect
- **Tags:** matrix, audit, logistics, routing, data-integrity

## Description

You shouldn't have to manually hunt for broken cells in a massive distance matrix. This MCP handles the heavy lifting of data validation for logistics and routing datasets. When you feed a matrix to your AI agent, it uses this MCP to check if the dimensions match or if there are missing connections that would crash your routing engine. It looks for the small errors that ruin large-scale optimizations, like negative travel times or inconsistent diagonal values where a point's distance to itself isn't zero. Instead of flagging problems, you can use it to apply correction rules to fix the data directly. It turns a messy spreadsheet or JSON object into a clean, mathematically sound matrix ready for your logistics software.

## Tools

### audit_matrix_logic
This tool checks for logical errors in your matrix. It identifies issues like inconsistent diagonals or broken symmetry in travel-time data.

### audit_matrix_structure
This tool validates the physical layout of your data. It finds missing cells, duplicate identifiers, or dimension mismatches.

### audit_matrix_values
This tool scans the actual numbers in your matrix. It flags negative values or extreme outliers that don't make sense for routing.

### reconcile_matrix
This tool applies correction rules to your dataset. It fixes the errors found during the audit process based on your specific requirements.

## Prompt Examples

**Prompt:** 
```
Check if this matrix is structurally complete: [{'id': 'A', 'values': [0, 5]}, {'id': 'B', 'values': [5]}]
```

**Response:** 
```
The matrix is incomplete. There is a dimension mismatch: point B is missing its value for the connection to point A.
```

**Prompt:** 
```
Are there any negative values in this matrix: [{'id': 'A', 'values': [0, -1]}, {'id': 'B', 'values': [-1, 0]}]
```

**Response:** 
```
The matrix contains invalid negative values at indices (A, B) and (B, A).
```

**Prompt:** 
```
Is the diagonal of this matrix correct: [{'id': 'A', 'values': [5, 2]}, {'id': 'B', 'values': [2, 0]}]
```

**Response:** 
```
The diagonal is inconsistent. The value for point A to itself is 5, but it should be 0.
```

## Capabilities

### Structural Validation
Your agent checks for missing data points or mismatched dimensions in the matrix.

### Value Auditing
Your agent scans for impossible values like negative distances or travel times.

### Logic Verification
Your client verifies that the matrix follows mathematical rules like symmetry or zero-value diagonals.

### Data Reconciliation
Your agent applies specific rules to fix identified errors in the dataset.

## Use Cases

### Route Optimization Prep
Verify that your distance matrix is complete and error-free before feeding it into a solver.

### Data Quality Audits
Run a full scan on existing logistics datasets to find hidden outliers or missing connections.

### Automated Data Cleaning
Use the reconciliation tool to fix structural errors in large-scale travel-time matrices.

### System Integration Testing
Check if new data exports from your GIS system contain the necessary dimensions and logical consistency.

## Benefits

- Catches dimension mismatches before they break your routing software.
- Identifies negative values that cause mathematical errors in optimization models.
- Automates the detection of symmetry and diagonal inconsistencies.
- Provides a way to apply correction rules to fix broken data.

## How It Works

Connect the MCP to your preferred AI client and start auditing data immediately.

1. Connect your AI client to the MCP via Vinkius.
2. Provide the matrix data to your AI agent.
3. Your agent runs the appropriate audit tool to find errors.
4. Your agent reports specific structural, value, or logic flaws.
5. Use the reconciliation tool to fix the errors if needed.

## Frequently Asked Questions

**What can this MCP fix in a distance matrix?**
It identifies missing cells, duplicate IDs, dimension mismatches, negative values, and logical errors like bad diagonals. You can then use the reconciliation tool to apply fixes.

**Which AI clients can use this MCP?**
You can use this MCP with any compatible client like Claude, Cursor, Windsurf, or VS Code.

**How does it handle negative values?**
The audit_matrix_values tool specifically scans for negative numbers that shouldn't exist in distance or time data.

**Do I need to host this myself?**
No, Vinkius hosts and manages the MCP for you. You connect your client and it works.

**Can it detect if a matrix is missing a connection?**
Yes, the audit_matrix_structure tool finds missing cells and dimension mismatches.

**What kind of errors can this tool detect?**
It detects structural issues like missing cells, logical errors like non-zero diagonals or asymmetry, and value errors like negative numbers or outliers.

**How do I fix errors found in my matrix?**
You can use the `reconcile_matrix` tool to apply specific correction rules to the identified problematic cells.

**Can I check if my matrix is symmetric?**
Yes, by using `audit_matrix_logic` and setting the symmetry enforcement parameter to true.
