Skip to main content
Glama

upsert_and_log

Find or create a custom food using the provided nutrition, then log it to a meal at the given date and time.

Instructions

Find-or-create a custom food then log it in one step

Searches the user's custom food library for food_name. If found, logs it immediately. If not found, creates it with the provided nutrition data and then logs it. This avoids duplicate food entries and removes the need for separate search → create → log round-trips.

Args: meal_date: Date in YYYY-MM-DD format meal_time: Time in HH:MM:SS format (account timezone); used to determine the meal automatically food_name: Name of the food to find or create calories: Calories per serving carbs: Carbohydrates in grams per serving protein: Protein in grams per serving fat: Total fat in grams per serving serving_unit: Unit for serving size (e.g. "G", "ML", "OZ"). Default "G" number_of_units: Serving size in the specified unit. Default 100 serving_qty: Number of servings to log (default 1)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fatNo
carbsNo
proteinNo
caloriesYes
food_nameYes
meal_dateYes
meal_timeYes
serving_qtyNo
serving_unitNoG
number_of_unitsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries full responsibility for conveying behavior. It explicitly describes the find-or-create-log workflow, including the conditional logic (search, then either log or create and log). It also clarifies that it uses the provided nutrition data only when creating a new food, implying that existing foods are logged as-is. No side effects are hidden or contradicted.

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 well-structured and appropriately concise. It opens with a one-sentence summary, adds a brief elaboration of the workflow, and then presents a clear, labeled parameter list. There is minimal redundancy; the opening sentence and the following paragraph complement each other rather than repeating information unnecessarily.

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

Completeness5/5

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

The description covers all necessary contextual information: it specifies the food source (custom food library), the condition for creating vs. logging, how meal_time is used, and the defaults for optional parameters. Since an output schema exists, the absence of return value details is acceptable. No critical usage details are missing.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description includes an 'Args:' section that provides semantic meaning for all 10 parameters, including the purpose of meal_time ('used to determine the meal automatically'), the units for nutrient values, and defaults for serving_unit and number_of_units. This fully compensates for the lack of schema property descriptions (0% schema coverage).

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

Purpose5/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: it finds or creates a custom food and logs it in one step. It explicitly names the resource (custom food library and nutrition log) and the actions (search, create, log). It also distinguishes itself from sibling tools by mentioning it avoids duplicate food entries and removes the need for separate search, create, and log round-trips.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage guidance by stating the conditional behavior: 'If found, logs it immediately. If not found, creates it...' It also explains when this tool is appropriate by highlighting the benefit of avoiding duplicate entries and multiple round-trips, which indirectly contrasts with using separate search, create, and log tools. This gives an agent sufficient context to decide when to invoke this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools