Skip to main content
Glama

get_nutrition_days_summary

Retrieve nutrition summaries for a specified date range to track dietary intake and monitor nutritional patterns over time.

Instructions

Get nutrition summaries for a date range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_dateNo
to_dateNo
limitNo
offsetNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the get_nutrition_days_summary tool. Queries the nutrition_days table and calculates totals for related meals/meal_items.
    def get_nutrition_days_summary(
        from_date: Optional[str] = None,
        to_date: Optional[str] = None,
        limit: int = 31,
        offset: int = 0,
    ) -> dict[str, list[dict[str, Any]]]:
        """Get nutrition summaries for a date range."""
        conn = get_connection()
        cursor = conn.cursor()
    
        filters = []
        params = []
        if from_date:
            filters.append("date >= ?")
            params.append(_ensure_date(from_date))
        if to_date:
            filters.append("date <= ?")
            params.append(_ensure_date(to_date))
    
        base = "SELECT * FROM nutrition_days"
        if filters:
            base += " WHERE " + " AND ".join(filters)
        base += " ORDER BY date DESC LIMIT ? OFFSET ?"
        params.extend([limit, offset])
    
        cursor.execute(base, params)
        days = []
        for row in cursor.fetchall():
            day = _row_to_dict(row)
            cursor.execute("SELECT * FROM meals WHERE day_id = ?", (day["id"],))
            meals = cursor.fetchall()
            items = []
            for m in meals:
                cursor.execute("SELECT * FROM meal_items WHERE meal_id = ?", (m["id"],))
                items.extend(cursor.fetchall())
            day["totals"] = {
                "calories": sum(i["calories"] for i in items) if items else 0,
                "protein_g": sum(i["protein_g"] for i in items) if items else 0,
                "carbs_g": sum(i["carbs_g"] for i in items) if items else 0,
                "fats_g": sum(i["fats_g"] for i in items) if items else 0,
                "fiber_g": sum(i["fiber_g"] for i in items) if items else 0,
            }
            days.append(day)
    
        conn.close()
        return {"days": days}
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 summaries but does not clarify if it's read-only, requires authentication, has rate limits, or describes the output format. The description lacks critical behavioral traits, leaving the agent with insufficient context for safe and effective use.

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 a single, efficient sentence with zero wasted words. It is appropriately sized and front-loaded, directly stating the tool's core function without unnecessary elaboration. Every part of the sentence earns its place by conveying essential 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 moderate complexity (4 parameters, no annotations) and the presence of an output schema, the description is minimally adequate. It covers the basic purpose but lacks details on parameter usage, behavioral traits, and differentiation from siblings. The output schema mitigates some gaps, but the description should do more to guide the agent effectively.

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

Parameters2/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 for undocumented parameters. It mentions a date range, which aligns with 'from_date' and 'to_date', but does not explain their format, defaults, or optionality. It omits any reference to 'limit' and 'offset' for pagination, failing to add meaningful semantics beyond the bare schema.

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

Purpose3/5

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

The description states the tool's purpose as retrieving nutrition summaries for a date range, which is clear but vague. It specifies the resource (nutrition summaries) and scope (date range) but lacks detail on what constitutes a 'summary' or how it differs from sibling tools like 'get_nutrition_day'. It avoids tautology by not merely restating the name.

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. The description does not mention sibling tools like 'get_nutrition_day' for single-day data or 'search_logs' for broader queries, nor does it specify prerequisites or exclusions. Usage is implied by the date range focus but not explicitly defined.

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/JohnZolton/MCP-logger'

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