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)}")
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a read-only operation by using 'Get', but doesn't specify permissions, rate limits, error conditions, or what happens if data is unavailable for the date. This leaves significant gaps for a tool that likely queries user data.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, with the core purpose stated first followed by parameter details. Both sentences add value, though the structure could be slightly improved by integrating the parameter explanation more seamlessly.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain the return format (e.g., structured data vs. text summary), error handling, or how it differs from sibling tools, making it inadequate for an agent to fully understand the tool's behavior and output.

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

Parameters3/5

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

Schema description coverage is 0%, but the description compensates by explaining the single parameter 'date' with format and default behavior. However, it doesn't add meaning beyond basic syntax, such as how invalid dates are handled or timezone considerations, leaving some ambiguity.

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

Purpose4/5

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

The description clearly states the tool's purpose: retrieving a daily nutrition overview including calories, macros, water, and goals. It specifies the verb 'Get' and resource 'daily nutrition overview', though it doesn't explicitly differentiate from siblings like 'get_daily_macros' or 'get_water_intake' which might overlap in scope.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_daily_macros' or 'get_water_intake', which seem to offer more specific data subsets. The description mentions a default date but doesn't clarify use cases or exclusions relative to siblings.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ai-mcp-garage/mcp-myfitnesspal'

If you have feedback or need assistance with the MCP directory API, please join our Discord server