Skip to main content
Glama

upsert_nutrition_day

Create or update daily nutrition entries to track food intake and dietary patterns within a fitness tracking system.

Instructions

Create or update a nutrition day entry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYes
notesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for the 'upsert_nutrition_day' tool, which inserts or updates a nutrition day record in the database.
    @app.tool()
    def upsert_nutrition_day(date: str, notes: Optional[str] = None) -> dict[str, int]:
        """Create or update a nutrition day entry."""
        date = _ensure_date(date)
        conn = get_connection()
        cursor = conn.cursor()
        cursor.execute(
            "INSERT INTO nutrition_days (date, notes) VALUES (?, ?) ON CONFLICT(date) DO UPDATE SET notes = ?",
            (date, notes, notes),
        )
        day_id = cursor.lastrowid or cursor.execute("SELECT id FROM nutrition_days WHERE date = ?", (date,)).fetchone()[0]
        conn.commit()
        conn.close()
        return {"day_id": day_id}
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 insight. 'Create or update' implies mutation but doesn't specify permissions needed, whether it's idempotent, what happens on conflicts, or typical response format. It mentions no rate limits, error conditions, or side effects beyond the basic operation.

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's front-loaded with the core action and resource, making it immediately scannable and appropriately sized for the tool's apparent complexity.

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 has an output schema (which should document return values), the description's minimalism is somewhat acceptable. However, for a mutation tool with zero annotation coverage and 2 parameters (one required), it should provide more context about behavior, parameter usage, and relationships to sibling tools to be fully complete.

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 schema provides no parameter documentation. The description adds no parameter semantics beyond the tool name implying 'date' is involved. It doesn't explain what 'date' format is expected, what 'notes' are for, or how they affect the upsert operation.

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 verb ('Create or update') and resource ('a nutrition day entry'), making the purpose immediately understandable. It distinguishes from sibling tools like 'get_nutrition_day' (read-only) and 'delete_nutrition_day' (destructive), though it doesn't explicitly differentiate from 'upsert_meal' which operates on a different resource.

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 doesn't mention prerequisites (e.g., whether a nutrition day must exist for updates), when to prefer 'create' vs 'update', or how it relates to siblings like 'get_nutrition_day' for checking existence or 'upsert_meal' for related operations.

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