query
Run read-only SQL queries against a personal health database to cross-reference workout, nutrition, and body measurement data.
Instructions
Read-only SQL against the health database. Must be a single SELECT or WITH statement.
Schema: products(id, name, brand, source, kcal_100g, protein_100g, carbs_100g, fat_100g, fibre_100g, sugar_100g, sat_fat_100g, salt_100g, note, created_at) food_log(id, logged_at, date, product_id, name, source, grams, entered_as, kcal, protein, carbs, fat, note) workouts(id, title, start_time, end_time, date, updated_at, raw) exercise_templates(id, title, primary_muscle_group, secondary_muscle_groups, equipment) workout_exercises(id, workout_id, idx, exercise_template_id, title) workout_sets(id, workout_exercise_id, idx, type, weight_kg, reps, rpe, duration_s, distance_m) body_measurements(date, weight_kg, fat_percent) sync_state(source, cursor, last_run_at, last_status, last_error)
date columns are always the 04:00 Europe/Amsterdam day, computed at write time —
group by date, not by a calendar date derived from a timestamp.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |