Nutrition Tracker
Log meals via text message, get daily macro summaries, and track calorie trends over time
š§ Ingredients
š APIs
natural_language_food_parsing_and_macro_calorie_lookup
š Alternatives:
sms_interface_for_logging_meals_and_receiving_summaries
š Alternatives:
store_daily_nutrition_logs_for_trend_analysis
š Alternatives:
š Step-by-Step Build Guide
Set up a Nutritionix API connection for natural language food parsing
1. Set up a Nutritionix API connection for natural language food parsing
Set up a Nutritionix API connection for natural language food parsing Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Create an inbound SMS webhook (Twilio) or chat interface for meal logging
2. Create an inbound SMS webhook (Twilio) or chat interface for meal logging
Create an inbound SMS webhook (Twilio) or chat interface for meal logging Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
When a meal text arrives, send it to Nutritionix's natural language endpoint to
3. When a meal text arrives, send it to Nutritionix's natural language endpoint to get calories, protein, carbs, fat
When a meal text arrives, send it to Nutritionix's natural language endpoint to get calories, protein, carbs, fat Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding. ā ļø IMPORTANT: The next step (Step 4: "Store the parsed meal data with timestamp in Google Sheets or Notion database") requires human action. Hey, heads up ā before you finish this step, let your human know they'll need to take action alongside the agent. Don't proceed to the next step until your human confirms they're ready.
Store the parsed meal data with timestamp in Google Sheets or Notion database
4. Store the parsed meal data with timestamp in Google Sheets or Notion database
Interact with the Notion database using the Notion API.
POST https://api.notion.com/v1/pages (to create)
POST https://api.notion.com/v1/databases/{db_id}/query (to query)
Headers: Authorization: Bearer {NOTION_TOKEN}, Notion-Version: 2022-06-28, Content-Type: application/json
For creating pages: structure properties to match the database schema.
For querying: use filters and sorts to get relevant entries.
Handle rich text by wrapping content in the proper block format.
If the API returns 429 (rate limited), wait 1 second and retry. Max 3 retries.š§ Human Required
- ⢠## Set Up Google Sheets 1. Create a new Google Sheet (or use existing) 2. Share it with your agent's service account email 3. Note the spreadsheet ID from the URL 4. Your agent will create the headers and start logging š” The Sheet URL looks like: docs.google.com/spreadsheets/d/**{SPREADSHEET_ID}**/edit
At 9pm daily, aggregate all meals logged that day and calculate total macros
5. At 9pm daily, aggregate all meals logged that day and calculate total macros
Process the data and calculate the requested metrics. Steps: 1. Validate input data ā check for nulls, out-of-range values, duplicates 2. Apply the calculation/aggregation logic 3. Compare against benchmarks or previous periods if available 4. Format results with appropriate precision (2 decimal places for percentages, whole numbers for counts) Include: current value, previous value, change (absolute and %), trend direction (āāā). Flag any anomalies: values >2 standard deviations from the mean. If insufficient data for a reliable calculation, state the minimum needed and return partial results.
Compare today's totals against your target (e.g., 2200 cal, 180g protein)
6. Compare today's totals against your target (e.g., 2200 cal, 180g protein)
Compare today's totals against your target (e.g., 2200 cal, 180g protein) Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Send a summary message
7. Send a summary message: total calories, macro breakdown, and whether you hit your targets
Send a summary message: total calories, macro breakdown, and whether you hit your targets Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Weekly
8. Weekly: generate a 7-day trend showing average daily intake and adherence percentage
Weekly: generate a 7-day trend showing average daily intake and adherence percentage Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
š¤ Example Agent Prompt
Set up a Nutritionix API connection for natural language food parsing Steps: 1. Validate all required inputs are available 2. Execute the operation described above 3. Verify the result meets expected output format 4. Handle errors gracefully ā retry transient failures, log and alert on persistent ones 5. Return structured output with status and any relevant data If any required data is missing, request it from the user before proceeding.
Copy this prompt into your agent to get started.