Skip to main content
Glama
ai-mcp-garage

MyFitnessPal MCP Server

get_daily_exercise

Retrieve daily exercise data from MyFitnessPal, including cardio duration and calories burned, plus strength training sets, reps, and weights for any specified date.

Instructions

Get exercise activities: cardio (duration, calories) and strength (sets, reps, weight).

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_exercise tool. It retrieves exercise data for a specified date from MyFitnessPal, processes cardio and strength activities to extract durations and calories burned, formats a markdown summary of individual exercises and totals, and returns it via text_response.
    def get_daily_exercise(date: Optional[str] = None):
        """
        Get exercise activities: cardio (duration, calories) and strength (sets, reps, weight).
        
        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)
            exercises = day.exercises
            
            output = f"# Exercise for {target_date.strftime('%B %d, %Y')}\n\n"
            
            if not exercises:
                output += "No exercise logged for this day.\n"
            else:
                # Collect all exercise entries from all exercise categories
                all_entries = []
                for exercise in exercises:
                    all_entries.extend(exercise.entries)
                
                if not all_entries:
                    output += "No exercise logged for this day.\n"
                else:
                    total_calories = 0
                    total_minutes = 0
                    
                    for entry in all_entries:
                        nutrition = entry.nutrition_information
                        
                        output += f"- **{entry.name}**\n"
                        
                        # Duration
                        minutes = nutrition.get('minutes')
                        if minutes:
                            output += f"  - Duration: {minutes:.0f} minutes\n"
                            total_minutes += minutes
                        
                        # Calories burned
                        calories = nutrition.get('calories burned', 0)
                        if calories:
                            output += f"  - Calories Burned: {calories:.0f} kcal\n"
                            total_calories += calories
                        
                        output += "\n"
                    
                    # Summary
                    output += "## Summary\n"
                    if total_minutes > 0:
                        output += f"- **Total Duration**: {total_minutes:.0f} minutes\n"
                    if total_calories > 0:
                        output += f"- **Total Calories Burned**: {total_calories:.0f} kcal\n"
            
            return text_response(output)
            
        except Exception as e:
            return text_response(f"Error retrieving exercise: {str(e)}")
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It implies this is a read operation ('Get'), but doesn't disclose permissions needed, rate limits, error conditions, or what happens when no data exists for the date. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 brief with two focused sentences. The first states the purpose and data structure, the second documents the parameter. There's no wasted text, though the structure could be slightly improved by integrating the parameter documentation more seamlessly rather than as a separate 'Args:' section.

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?

For a tool with no annotations, no output schema, and 0% schema description coverage, the description is insufficient. It doesn't explain the return format (structure of cardio/strength data), error handling, authentication requirements, or how it differs from summary tools. The agent would struggle to use this effectively without additional context.

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%, so the description must compensate. It documents the single parameter's purpose (date filtering) and format (YYYY-MM-DD), and mentions the default behavior (today). However, it doesn't explain what 'null' means for the date parameter or how the default is applied, leaving some semantic gaps despite covering the basic parameter purpose.

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 retrieves exercise activities with specific data fields (cardio duration/calories, strength sets/reps/weight). It distinguishes from siblings like get_daily_macros or get_daily_meals by focusing on exercise rather than nutrition. However, it doesn't explicitly contrast with get_daily_summary which might also include exercise data.

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 provides no guidance on when to use this tool versus alternatives like get_daily_summary or get_date_range_summary. It mentions the date parameter defaults to today, but offers no context about appropriate use cases, prerequisites, or exclusions compared to sibling tools.

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