# Continuous Glucose Trend Calculator AI Agent Connect

> Predictive CGM glucose velocity and trend arrow analysis.

## Overview
- **Category:** health
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_OZMPt8KhY73kZ4I51tyy5rp8PlzQ1CAZRZey4Nwn/ai-agent-connect
- **Tags:** glucose, cgm, diabetes, predictive, health-tech

## Description

This MCP server provides deterministic predictive analysis for Continuous Glucose Monitor (CGM) data. It calculates glucose velocity (rate of change), identifies visual trend arrows, and predicts future glucose levels. Use `calculate_glucose_trends` to determine the direction of glucose movement and receive proactive safety actions if rapid drops are detected. It also includes `validate_glucose_readings` to ensure data consistency and `get_velocity_threshold_definitions` to understand the velocity boundaries used for trend classification.

## Tools

### calculate_glucose_trends
Calculates the velocity, visual trend symbol, and future glucose prediction based on a window of historical readings

### get_velocity_threshold_definitions
Retrieves the boundary values for all trend arrow classifications

### validate_glucose_readings
Ensures the provided glucose history is chronologically consistent and physically possible

## Prompt Examples

**Prompt:** 
```
Analyze these glucose readings: current 90, 15 mins ago 110, 30 mins ago 130.
```

**Response:** 
```
The rate of change is -1.33 mg/dL/min. The trend is 'Diagonal Down'. The predicted glucose in 30 minutes is 40 mg/dL. Proactive action: none.
```

**Prompt:** 
```
What is the trend if my current glucose is 80 and 30 minutes ago it was 180?
```

**Response:** 
```
The rate of change is -3.33 mg/dL/min. The trend is 'Double Down'. The predicted glucose in 30 minutes is -20 mg/dL. Proactive action: consume 15g carbs immediately.
```

**Prompt:** 
```
Check the trend for current 150, 15 mins ago 145, 30 mins ago 140.
```

**Response:** 
```
The rate of change is 0.33 mg/dL/min. The trend is 'Flat'. The predicted glucose in 30 minutes is 160 mg/dL. Proactive action: none.
```

## Frequently Asked Questions

**How does the trend arrow prediction work?**
The tool calculates the rate of change by comparing the current glucose reading with the reading from 30 minutes ago. This velocity is then used to assign a trend arrow like 'Double Up' or 'Double Down'.

**What is a proactive action?**
A proactive action is a safety recommendation. For example, if `calculate_glucose_trends` detects a 'Double Down' trend while glucose is below 100 mg/dL, it will recommend consuming 15g of carbs immediately.

**Can I validate my CGM data?**
Yes, you can use the `validate_glucose_readings` tool to check if your glucose history is chronologically consistent and physically possible.
