Skip to main content
Glama

Log food

log_food
Idempotent

Log one or more food items the user ate. Put EACH food as its own item (e.g. chicken, rice and sauce separately) with realistic portions and your best nutrient estimates. Always estimate fiber_g and sugar_g; include sodium_mg/alcohol_g when relevant. Omit a nutrient you can't estimate rather than sending 0. For packaged/branded foods prefer search_food_database + log_food_from_database. PHOTOS WITH A BARCODE: if a photo shows a barcode, read its digits and call lookup_barcode FIRST, then log_food_from_database scaled to the portion; only estimate here when there is no readable barcode or the lookup finds nothing (also use nutrition-label values printed in the photo when visible). THE LABEL WINS: when the photo shows the nutrition label and its numbers differ from the lookup (or the lookup carries a warning, or the user says 'use the label'), log here with the label's values scaled to the portion eaten, and offer save_food so it's right next time. meal_type: use what the user said; if they didn't, omit it and Heza picks it from the local time eaten (breakfast before 11:00, lunch 11-15, snack 15-18, dinner 18-22). The result starts with the user's current local time. Use idempotency_key so retries don't create duplicates. Returns the saved entries and the day's totals vs goals.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "items": "<items>"
    },
    "name": "log_food"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoLocal date YYYY-MM-DD (or 'today'/'yesterday'). Defaults to today in the user's timezone.
itemsYes
logged_atNoWhen it was eaten: HH:MM (local) or ISO datetime. Defaults to now (or noon for past dates).
from_photoNoTrue when the estimate comes from a meal photo.
idempotency_keyNoUnique key for this logging request (e.g. a UUID you generate). Re-sending the same key never duplicates entries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=true), and the description adds substantial context beyond them: retries are safe via idempotency_key, the result begins with the user's local time and returns saved entries plus the day's totals vs goals, and meal_type is auto-derived from local time when omitted. It also discloses a non-obvious data-quality rule — omit an unestimable nutrient rather than sending 0.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first sentence and the remaining text is organized as decision rules (packaged foods, barcode photos, label precedence, meal_type, retries) rather than prose. It is dense and long, with some all-caps emphasis and overlapping nutrient guidance, but nearly every sentence carries an actionable rule.

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?

For a 5-parameter mutation tool with no output schema, the description covers what an agent needs: fallback precedence against three sibling tools, nutrient-omission policy, meal_type defaulting, retry semantics, and an explicit statement of what is returned (saved entries and day totals vs goals). Date, quantity, and from_photo details are left to the schema, which documents them adequately.

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?

Schema coverage is 80%, so the schema already carries most parameter meaning; the description still adds real guidance the schema lacks, namely always estimating fiber_g and sugar_g, including sodium_mg/alcohol_g only when relevant, and modeling realistic portions with each food as its own item. The meal_type defaulting logic largely restates what the schema description already says, so it is not fully additive.

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?

States a specific verb and resource ("Log one or more food items the user ate") and immediately disambiguates from siblings by naming search_food_database + log_food_from_database, lookup_barcode, and save_food in the correct precedence order. An agent can route to this tool without opening another schema.

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?

Gives explicit when-to-use and when-not-to-use rules: prefer the database path for packaged/branded foods, call lookup_barcode first when a barcode is visible, and fall back to estimating here only when no barcode is readable or the lookup finds nothing. The 'THE LABEL WINS' rule resolves the otherwise ambiguous conflict between lookup values and label values.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources