Skip to main content
Glama

delete_nutrition_day

Remove a nutrition day from fitness tracking records and optionally delete associated meals and food items to maintain clean data.

Instructions

Delete a nutrition day and optionally cascade to meals/items.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes
cascadeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the 'delete_nutrition_day' tool, which deletes a nutrition day from the database, with an optional cascading delete for associated meals and meal items.
    @app.tool()
    def delete_nutrition_day(date: str, cascade: bool = True) -> dict[str, bool]:
        """Delete a nutrition day and optionally cascade to meals/items."""
        date = _ensure_date(date)
        conn = get_connection()
        cursor = conn.cursor()
        if cascade:
            # Get meal IDs first
            cursor.execute("SELECT id FROM meals WHERE day_id IN (SELECT id FROM nutrition_days WHERE date = ?)", (date,))
            meal_ids = [r[0] for r in cursor.fetchall()]
            if meal_ids:
                placeholders = ",".join("?" * len(meal_ids))
                cursor.execute(f"DELETE FROM meal_items WHERE meal_id IN ({placeholders})", meal_ids)
            cursor.execute("DELETE FROM meals WHERE day_id IN (SELECT id FROM nutrition_days WHERE date = ?)", (date,))
        cursor.execute("DELETE FROM nutrition_days WHERE date = ?", (date,))
        conn.commit()
        conn.close()
        return {"deleted": cursor.rowcount > 0}
Behavior2/5

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

With no annotations provided, the description carries full burden. It discloses the destructive nature ('Delete') and optional cascading behavior, which is critical. However, it omits key behavioral traits: permissions required, whether deletion is reversible, rate limits, error responses, or what 'cascade' entails precisely. For a destructive operation, this leaves significant gaps.

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 that front-loads the core action and includes the key optional behavior. Every word earns its place with no redundancy or fluff, making it easy to parse quickly.

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 a destructive tool with 2 parameters, 0% schema coverage, no annotations, but an output schema exists, the description is minimally adequate. It covers the basic action and cascading option, but lacks details on permissions, side effects, or error handling. The output schema may help, but the description doesn't reference it, leaving gaps in overall 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 adds meaning by explaining that 'cascade' affects 'meals/items', clarifying its purpose beyond a boolean flag. However, it doesn't describe the 'date' parameter's format or semantics. With 2 parameters and partial coverage, this meets the baseline for moderate schema support.

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 action ('Delete') and target resource ('a nutrition day'), with additional scope ('optionally cascade to meals/items'). It distinguishes from sibling 'delete_meal' and 'delete_meal_item' by targeting the broader 'nutrition day' entity. However, it doesn't explicitly contrast with 'upsert_nutrition_day' for update scenarios.

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 explicit guidance on when to use this tool versus alternatives like 'delete_meal' or 'delete_meal_item' is provided. The description implies usage for deleting nutrition days, but lacks context on prerequisites, error conditions, or typical workflows. Sibling tools suggest a nutrition/meal management system, but no integration advice is given.

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