# Diagnostic Test Performance Calculator AI Agent Connect

> Diagnostic Test Performance Calculator MCP handles the heavy lifting of clinical statistics. It takes raw confusion matrix data like True Positives and False Negatives and calculates sensitivity, specificity, accuracy, and confidence intervals. Your AI client uses this to bridge the gap between raw patient data and the statistical insights needed for clinical validation.

## Overview
- **Category:** healthcare
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_ute4eVFnew5Ia7wgFJShtVRw22fZoYWzUTdHfhQd/ai-agent-connect
- **Tags:** diagnostics, sensitivity, specificity, confusion-matrix, clinical-metrics

## Description

You have the raw counts from a diagnostic study, but you need the actual performance metrics. This MCP lets your AI client perform precise clinical diagnostic analysis without you having to manually run formulas. Instead of calculating sensitivity or specificity yourself, you provide the True Positives, True Negatives, False Positives, and False Negatives, and your agent does the rest. It supports statistical confidence intervals using both Wald and Wilson methods, ensuring your results include the necessary uncertainty bounds. Whether you are looking for a full suite of metrics or just need to isolate error rates like false positives, this tool provides the mathematical backbone for your clinical reporting. It turns a messy confusion matrix into a clean, actionable statistical summary.

## Tools

### calculate_error_rates
Use this to isolate and calculate specific error-related metrics like False Positive and False Negative rates.

### get_metric_summary
This tool provides a high-level summary of a single metric's performance along with its uncertainty bounds.

### validate_contingency_integrity
This tool checks if your provided counts represent a logically sound population for diagnostic testing.

### calculate_diagnostic_metrics
This tool computes the full suite of diagnostic performance statistics from your raw counts.

## Prompt Examples

**Prompt:** 
```
Calculate the diagnostic metrics for a test with 90 TP, 80 TN, 5 FP, and 5 FN using the Wilson method.
```

**Response:** 
```
The diagnostic metrics are: Sensitivity: 0.90, Specificity: 0.941, Accuracy: 0.925. The 95% Wilson confidence intervals are: Sensitivity [0.82, 0.95], Specificity [0.88, 0.97], and Accuracy [0.87, 0.96].
```

**Prompt:** 
```
What is the false positive rate for 10 TP, 90 TN, 10 FP, and 0 FN?
```

**Response:** 
```
The False Positive Rate is 0.10 (10%) and the total number of errors is 10.
```

**Prompt:** 
```
Summarize the accuracy for a report where sensitivity is 0.85 (0.78-0.91), specificity is 0.90 (0.83-0.95), and accuracy is 0.88 (0.80-0.94).
```

**Response:** 
```
The accuracy is 0.88, with a lower bound of 0.80 and an upper bound of 0.94.
```

## Capabilities

### Statistical Confidence Intervals
Your agent calculates uncertainty using Wald or Wilson methods.

### Error Rate Isolation
The AI identifies specific false positive and false negative rates from raw data.

### Data Integrity Checks
The tool verifies that your confusion matrix counts are logically consistent.

### Metric Summarization
Your agent generates high-level reports on specific performance metrics.

## Use Cases

### Clinical Trial Analysis
Convert raw test results from a new diagnostic tool into a full performance report.

### Error Rate Auditing
Isolate false positive and false negative rates to evaluate test reliability.

### Statistical Reporting
Generate confidence intervals for accuracy and sensitivity for formal documentation.

### Data Validation
Ensure that confusion matrix data is logically sound before running further analysis.

## Benefits

- Calculates sensitivity and specificity directly from raw counts.
- Provides statistical uncertainty via Wald and Wilson methods.
- Validates the logical integrity of population counts.
- Isolates specific error rates for targeted analysis.

## How It Works

Connect your AI client to the Vinkius-hosted MCP to start running clinical calculations.

1. Connect your AI client to the MCP through the Vinkius dashboard.
2. Provide the raw confusion matrix counts to your AI agent.
3. The agent calls the appropriate tool to process the numbers.
4. Your agent receives the calculated metrics and confidence intervals.
5. Use the results in your clinical reports or further analysis.

## Frequently Asked Questions

**What statistical methods are used for confidence intervals?**
The MCP uses both Wald and Wilson methods to calculate confidence intervals for diagnostic metrics.

**Can I calculate error rates specifically?**
Yes, the calculate_error_rates tool is designed to isolate False Positive and False Negative rates.

**How do I use this with Claude or Cursor?**
You connect your client to the Vinkius-hosted MCP once, and then you can use the tools directly within your existing AI workflows.

**Does this tool check if my data is valid?**
Yes, the validate_contingency_integrity tool verifies if your counts represent a logically sound population.

**What kind of data does the MCP need?**
The MCP requires raw confusion matrix counts, specifically True Positives, True Negatives, False Positives, and False Negatives.

**Can I calculate error rates separately?**
Yes, you can use the `calculate_error_rates` tool to specifically isolate the False Positive Rate, False Negative Rate, and the total count of errors.

**How do I verify if my input counts are valid?**
You can use the `validate_contingency_integrity` tool to ensure your TP, TN, FP, and FN counts are non-negative integers and represent a valid population.
