Skip to main content
Glama
ai-mcp-garage

MyFitnessPal MCP Server

get_daily_summary

Retrieve daily nutrition overview including calories consumed and remaining, macro breakdown, water intake, and goal progress from MyFitnessPal data.

Instructions

Get daily nutrition overview: calories consumed/remaining, macro breakdown, water, and goals.

Args: date: Date in YYYY-MM-DD format (defaults to today)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNo

Implementation Reference

  • The handler function decorated with @mcp.tool that implements the get_daily_summary tool. It fetches daily nutrition data from MyFitnessPal, computes summaries for calories, macros, exercise, water, and formats as markdown.
    @mcp.tool
    def get_daily_summary(date: Optional[str] = None):
        """
        Get daily nutrition overview: calories consumed/remaining, macro breakdown, water, and goals.
        
        Args:
            date: Date in YYYY-MM-DD format (defaults to today)
        """
        try:
            target_date = parse_date(date)
            client = get_client()
            
            # Fetch day data
            day = client.get_day(target_date)
            
            totals = day.totals
            goals = day.goals
            
            # Extract key nutrients
            calories = totals.get('calories', 0)
            carbs = totals.get('carbohydrates', 0)
            fat = totals.get('fat', 0)
            protein = totals.get('protein', 0)
            
            # Goals
            calorie_goal = goals.get('calories', 0)
            carb_goal = goals.get('carbohydrates', 0)
            fat_goal = goals.get('fat', 0)
            protein_goal = goals.get('protein', 0)
            
            # Water (library returns milliliters)
            water_ml = day.water
            water_oz = water_ml / 29.5735  # Convert ml to oz
            water_cups = water_ml / 236.588  # Convert ml to cups
            
            # Exercise summary
            exercises = day.exercises
            total_exercise_calories = 0
            total_exercise_minutes = 0
            exercise_count = 0
            
            for exercise in exercises:
                for entry in exercise.entries:
                    exercise_count += 1
                    nutrition = entry.nutrition_information
                    total_exercise_calories += nutrition.get('calories burned', 0)
                    minutes = nutrition.get('minutes')
                    if minutes:
                        total_exercise_minutes += minutes
            
            # Format output
            output = f"""# Daily Summary for {target_date.strftime('%B %d, %Y')}
    
    ## Calories
    - **Consumed**: {calories:.0f} kcal
    - **Goal**: {calorie_goal:.0f} kcal
    - **Remaining**: {calorie_goal - calories:.0f} kcal
    
    ## Macronutrients
    - **Carbohydrates**: {carbs:.0f}g / {carb_goal:.0f}g
    - **Fat**: {fat:.0f}g / {fat_goal:.0f}g
    - **Protein**: {protein:.0f}g / {protein_goal:.0f}g
    
    ## Exercise
    - **Activities**: {exercise_count}
    - **Duration**: {total_exercise_minutes:.0f} minutes
    - **Calories Burned**: {total_exercise_calories:.0f} kcal
    
    ## Water Intake
    - **Amount**: {water_oz:.0f} oz ({water_cups:.1f} cups, {water_ml:.0f} ml)
    
    ## Status
    - **Day Complete**: {'Yes' if day.complete else 'No'}
    - **Meals Logged**: {len(day.meals)}
    """
            
            return text_response(output)
            
        except Exception as e:
            return text_response(f"Error retrieving daily summary: {str(e)}")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions the default date behavior but does not disclose any other behavioral traits like idempotency, authentication requirements, or side effects. It is a read operation, but without annotations, the description offers minimal transparency beyond the obvious.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences plus a parameter block, with no redundant information. It front-loads the purpose and immediately follows with parameter details. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one optional parameter and no output schema, the description covers the key return elements (calories, macros, water, goals) and parameter format. It lacks examples or structure of the output, but is sufficient for basic usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It provides format ('YYYY-MM-DD'), default behavior ('defaults to today'), and type (date). This adds meaningful value beyond the schema's type definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool provides a daily nutrition overview including calories, macros, water, and goals. It uses specific verbs ('Get') and resource ('daily nutrition overview'), and distinguishes from siblings like get_daily_macros and get_water_intake by implying a combined view.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description lists what the tool returns but provides no guidance on when to use it over siblings (e.g., get_daily_macros for detailed macros, get_date_range_summary for multiple days). No when-not-to-use or alternative suggestions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.