Skip to main content
Glama
ai-mcp-garage

MyFitnessPal MCP Server

get_daily_meals

Retrieve detailed meal breakdowns with foods, servings, and calories from MyFitnessPal for any date to track nutrition intake.

Instructions

Get detailed meal-by-meal breakdown with all foods, servings, and calories.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNo

Implementation Reference

  • The main handler function for the 'get_daily_meals' tool. It is decorated with @mcp.tool, which registers it in the FastMCP server. The function parses the date, fetches the day's data using MyFitnessPalClient, iterates through meals and entries to build a detailed markdown summary of meals, foods, servings, calories, and macros, and returns it wrapped in text_response.
    @mcp.tool
    def get_daily_meals(date: Optional[str] = None):
        """
        Get detailed meal-by-meal breakdown with all foods, servings, and calories.
        
        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)
            
            output = f"# Meals for {target_date.strftime('%B %d, %Y')}\n\n"
            
            if not day.meals:
                output += "No meals logged for this day.\n"
            else:
                for meal in day.meals:
                    meal_totals = meal.totals
                    meal_calories = meal_totals.get('calories', 0)
                    
                    output += f"## {meal.name}\n"
                    output += f"**Total**: {meal_calories:.0f} kcal"
                    
                    # Show meal macros
                    meal_carbs = meal_totals.get('carbohydrates', 0)
                    meal_fat = meal_totals.get('fat', 0)
                    meal_protein = meal_totals.get('protein', 0)
                    output += f" ({meal_carbs:.0f}C / {meal_fat:.0f}F / {meal_protein:.0f}P)\n\n"
                    
                    if meal.entries:
                        for entry in meal.entries:
                            nutrition = entry.nutrition_information
                            
                            output += f"- **{entry.name}**\n"
                            output += f"  - Serving: {entry.quantity} {entry.unit}\n"
                            output += f"  - Calories: {nutrition.get('calories', 0):.0f} kcal\n"
                            output += f"  - Macros: "
                            output += f"{nutrition.get('carbohydrates', 0):.0f}C / "
                            output += f"{nutrition.get('fat', 0):.0f}F / "
                            output += f"{nutrition.get('protein', 0):.0f}P\n"
                        output += "\n"
                    else:
                        output += "No foods logged in this meal.\n\n"
            
            return text_response(output)
            
        except Exception as e:
            return text_response(f"Error retrieving meals: {str(e)}")
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves data ('Get'), implying a read-only operation, but doesn't clarify permissions, rate limits, error handling, or response format. The description adds minimal behavioral context beyond the basic action, which is insufficient for a tool with no annotation coverage.

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 appropriately sized and front-loaded, with the core purpose stated in the first sentence and parameter details in a clear 'Args:' section. Every sentence adds value: the first defines the tool's output, and the second explains the parameter. There's no redundancy or unnecessary information.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is somewhat complete but has gaps. It covers the parameter semantics well but lacks usage guidelines and behavioral details like response structure or error cases. For a simple read tool, this is adequate but not fully comprehensive.

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?

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains the 'date' parameter's purpose ('Date in YYYY-MM-DD format') and default behavior ('defaults to today'), compensating for the schema's lack of documentation. Since there's only one parameter, this effectively covers all inputs, making it highly valuable.

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: 'Get detailed meal-by-meal breakdown with all foods, servings, and calories.' This specifies the verb ('Get'), resource ('meal-by-meal breakdown'), and scope ('detailed'), distinguishing it from siblings like get_daily_macros or get_daily_summary. However, it doesn't explicitly differentiate from get_date_range_summary, which might offer similar breakdowns over multiple dates.

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. It mentions the date parameter but doesn't explain when to choose this over siblings like get_daily_summary or get_date_range_summary. There's no context on prerequisites, exclusions, or typical use cases, leaving the agent to infer usage from tool names alone.

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