get_trend_data_es
Analyze health data trends over time by aggregating specific record types (e.g., steps, heart rate) into daily, weekly, monthly, or yearly intervals. Returns statistics like average, min, max, and count for each period.
Instructions
Get trend data for a specific health record type over time using Elasticsearch date histogram aggregation.
Parameters:
record_type: The type of health record to analyze (e.g., "HKQuantityTypeIdentifierStepCount")
interval: Time interval for aggregation.
date_from, date_to: Optional ISO8601 date strings for filtering date range
Returns:
record_type: The analyzed record type
interval: The time interval used
trend_data: List of time buckets with statistics for each period:
date: The time period (ISO string)
avg_value: Average value for the period
min_value: Minimum value for the period
max_value: Maximum value for the period
count: Number of records in the period
Notes for LLMs:
Use this to analyze trends, patterns, and seasonal variations in health data
The function automatically handles date filtering if date_from/date_to are provided
IMPORTANT - interval must be one of: "day", "week", "month", or "year". Do not use other values.
Do not guess, auto-fill, or assume any missing data.
When asked for medical advice, try to use my data from ElasticSearch first.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
date_from | No | ||
date_to | No | ||
interval | No | month | |
record_type | Yes |