# Serial Interval Distribution Calculator AI Agent Connect

> Serial Interval Distribution Calculator is a specialized tool for infectious disease epidemiology. It gives your AI client the ability to process symptom-onset timestamps, calculate time differences between infector and infectee pairs, and generate statistical summaries of interval distributions. It handles the heavy lifting of epidemiological math, including censoring rules and negative interval policies, so you can focus on analysis.

## Overview
- **Category:** statistics
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_Ej1chL0tgAzQeYmBj0P2SOd48YL2HsMlQH3D6Xgu/ai-agent-connect
- **Tags:** epidemiology, serial-interval, statistics, infectious-disease, data-analysis

## Description

You can now give your AI agent the mathematical precision required for infectious disease modeling. This MCP handles the complex temporal math involved in calculating serial intervals from symptom-onset data. Instead of manually calculating time differences or checking for data errors, you can hand raw timestamp pairs to your AI client and get immediate, statistically sound results. 

It manages the nuances of epidemiological data, such as handling negative intervals and applying specific censoring rules. You can use it to validate that your infector-infectee pairs are temporally sound before running a full analysis. Once the data is clean, your agent can summarize the entire distribution, providing means, medians, and quantiles. It is built to turn raw, messy timestamp datasets into structured epidemiological insights without you having to write custom scripts for every new outbreak or study.

## Tools

### get_interval_metadata
This tool retrieves descriptive characteristics and high-level details about your input dataset.

### summarize_distribution
This tool generates statistical summaries, including means and quantiles, for your calculated serial intervals.

### validate_pair_timestamps
This tool checks your infector-infectee pairs to ensure the timestamps are logically and temporally valid.

### calculate_serial_intervals
This tool calculates the specific time intervals for every infector and infectee pair you provide.

## Prompt Examples

**Prompt:** 
```
Calculate the serial intervals for these pairs: [{'infectorId': 'A', 'infecteeId': 'B', 'infectorTimestamp': '2023-01-01T10:00:00Z', 'infecteeTimestamp': '2023-01-05T10:00:00Z'}] using UTC timezone.
```

**Response:** 
```
[{"infectorId": "A", "infecteeId": "B", "intervalDays": 4.0, "status": "complete"}]
```

**Prompt:** 
```
What is the statistical summary for these intervals: [{'infectorId': 'A', 'infecteeId': 'B', 'intervalDays': 4.0, 'status': 'complete'}, {'infectorId': 'C', 'infecteeId': 'D', 'intervalDays': 6.0, 'status': 'complete'}] using arithmetic method?
```

**Response:** 
```
{"mean": 5.0, "median": 5.0, "standardDeviation": 1.414, "quantiles": {"25th": 4.5, "50th": 5.0, "75th": 5.5}, "negativeIntervalCount": 0, "excludedPairCount": 0}
```

**Prompt:** 
```
Check if these timestamps are valid: [{'infectorId': '1', 'infecteeId': '2', 'infectorTimestamp': '2023-01-01T10:00:00Z', 'infecteeTimestamp': '2023-01-05T10:00:00Z'}]
```

**Response:** 
```
{"isValid": true, "missingTimestamps": [], "outOfOrderPairs": []}
```

## Capabilities

### Temporal Validation
Your agent checks if infector and infectee timestamps are logically ordered and complete.

### Interval Calculation
The MCP computes the exact time difference between symptom onsets for transmission pairs.

### Statistical Summarization
Your AI client generates means, medians, and quantiles from the calculated intervals.

### Dataset Profiling
The tool extracts descriptive metadata to characterize the input dataset.

### Epidemiological Logic
The MCP applies specific censoring rules and negative interval policies to the data.

## Use Cases

### Outbreak Analysis
Calculate the serial interval distribution during an active infectious disease outbreak to understand transmission speed.

### Data Cleaning
Use the validation tool to find missing or out-of-order timestamps in large epidemiological datasets.

### Transmission Modeling
Generate the statistical parameters needed to feed into more complex infectious disease models.

### Dataset Characterization
Quickly get metadata and descriptive statistics for a new set of transmission pairs.

## Benefits

- Automates the calculation of time differences between infector and infectee onsets.
- Validates timestamp integrity to prevent errors in transmission modeling.
- Provides instant statistical summaries like means and quantiles.
- Handles complex epidemiological rules like censoring and negative interval policies.

## How It Works

Connect your AI client to Vinkius to start running epidemiological calculations immediately.

1. Connect your preferred MCP-compatible client to the Vinkius platform.
2. Provide your infector-infectee timestamp pairs to your AI agent.
3. The agent uses the MCP tools to validate, calculate, or summarize the data.
4. Receive structured statistical results or validated data directly in your chat interface.

## Frequently Asked Questions

**What is a serial interval?**
In epidemiology, it is the time between symptom onsets in a pair of individuals where one infects the other.

**Can this MCP handle negative intervals?**
Yes, the MCP includes specific policies for handling negative intervals as part of its epidemiological logic.

**Which AI clients can use this MCP?**
Any MCP-compatible client like Claude, Cursor, Windsurf, or VS Code can use this tool once connected via Vinkius.

**Does it support UTC timestamps?**
Yes, the tools are designed to work with timestamp data, including UTC formats.

**How does it handle data validation?**
The validate_pair_timestamps tool checks for missing timestamps and out-of-order pairs to ensure data integrity.

**How are negative intervals handled?**
You can specify a `negativeIntervalPolicy` to either keep, discard, or treat negative intervals as zero during the `calculate_serial_intervals` process.

**Can I calculate the mean and median of the intervals?**
Yes, by using the `summarize_distribution` tool, you can obtain the mean, median, standard deviation, and quantiles for your dataset.

**What format should the timestamps be in?**
All timestamps must be valid ISO 8601 strings to ensure accurate calculations via `validate_pair_timestamps`.
