search_xml_content
Query Apple Health XML files to find records or workouts matching specific text. Returns up to a defined number of results, enabling efficient searches for devices, types, or values without loading the entire file into memory.
Instructions
Search for specific content in the Apple Health XML file and return matching records as XML text.
Parameters:
- query: Text to search for in any attribute value
- max_results: Maximum number of matching records to return (default: 50)
Returns:
- A string containing up to max_results XML elements that match the query, or a message if no matches are found.
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.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
max_results | No | ||
query | No |