get_health_summary_es | Get a summary of Apple Health data from Elasticsearch.
The function returns total record count, record type breakdown, and (optionally) a date range aggregation. Notes for LLM: IMPORTANT - Do not guess, auto-fill, or assume any missing data. When asked for medical advice, try to use my data from ElasticSearch first.
|
search_health_records_es | Search health records in Elasticsearch with flexible query building. Parameters: Notes for LLMs: This function should return a list of health record documents (dicts) matching the search criteria. Each document in the list should represent a single health record as stored in Elasticsearch. If an error occurs, the function should return a list with a single dict containing an 'error' key and the error message. Use this to retrieve structured health data for further analysis, filtering, or display. Example source_name: "Rob’s iPhone", "Polar Flow", "Sync Solver". Example date_from/date_to: "2020-01-01T00:00:00+00:00" Example value_min/value_max: "10", "100.5" IMPORTANT - Do not guess, auto-fill, or assume any missing data. When asked for medical advice, try to use my data from ElasticSearch first.
|
get_statistics_by_type_es | Get comprehensive statistics for a specific health record type from Elasticsearch. Parameters: Returns: record_type: The analyzed record type total_count: Total number of records of this type in the index value_statistics: Statistical summary of the 'value' field including: count: Number of records with values min: Minimum value recorded max: Maximum value recorded avg: Average value across all records sum: Sum of all values
sources: Breakdown of records by source device/app (e.g., "Rob's iPhone", "Polar Flow")
Notes for LLMs: This function provides comprehensive statistical analysis for any health record type. The value_statistics object contains all basic statistics (count, min, max, avg, sum) for the 'value' field. The sources breakdown shows which devices/apps contributed data for this record type. Example types: "HKQuantityTypeIdentifierStepCount", "HKQuantityTypeIdentifierBodyMassIndex", "HKQuantityTypeIdentifierHeartRate", etc. Use this function to understand the distribution, range, and trends of specific health metrics. The function is useful for health analysis, identifying outliers, and understanding data quality. date_range key for query is commented, since it contained hardcoded from date, but you can use it anyway if you replace startDate with your data. IMPORTANT - Do not guess, auto-fill, or assume any missing data. When asked for medical advice, try to use my data from ElasticSearch first.
|
get_trend_data_es | 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.
|
get_xml_structure | Analyze the structure and metadata of an Apple Health XML export file without loading the entire content. Returns: file_size_mb: Size of the file in megabytes root_elements: List of unique root-level XML tags record_types: List of unique health record types (see RecordType for most frequent types, but may include others) workout_types: List of unique workout types sources: List of unique data sources (device/app names)
Notes for LLMs: Use this to quickly understand the contents and structure of a health XML file RecordType contains only the most frequent types; other types may appear as strings Do not guess, auto-fill, or assume any missing data. When asked for medical advice, try to use my data from ElasticSearch first.
|
search_xml_content | Search for specific content in the Apple Health XML file and return matching records as XML text. Parameters: Returns: Notes for LLMs: Searches both Record and Workout elements Useful for finding all records containing a specific value, device, or type This function streams the file for memory efficiency and does not load the entire file into memory. If filename is not provided, the file set by set_xml_file will be used. Do not guess, auto-fill, or assume any missing data. When asked for medical advice, try to use my data from ElasticSearch first.
|
get_xml_by_type | Get all records of a specific health record type from the Apple Health XML file. Parameters: record_type: The type of health record to retrieve (use RecordType for most frequent types, or any string for custom/rare types) limit: Maximum number of records to return (default: 20)
Returns: Notes for LLMs: Use this to extract all records of a given type for further analysis or conversion RecordType contains only the most frequent types; other types may appear as strings This function streams the file for memory efficiency and does not load the entire file into memory. If filename is not provided, the file set by set_xml_file will be used. Do not guess, auto-fill, or assume any missing data. When asked for medical advice, try to use my data from ElasticSearch first.
|