Skip to main content
Glama

log_food

Log meals by entering food items, amounts, or barcodes; matches nutrition data from USDA and Open Food Facts, then returns daily totals.

Instructions

Log food. Usually pass the user's words as text ("2 eggs, toast and a protein shake", "lunch: 200g chicken, 1 cup rice"); it is split into items and each is matched to USDA FoodData Central or Open Food Facts. For one item: name (or barcode, or a food_id from lookup_food) with grams, or amount + unit (cup, slice, tbsp, oz, ml...). Pass kcal/protein/carbs/fat when the user reads them off a label. meal: breakfast, lunch, dinner or snack (default from the words, else the time of day). Each item has a status: ok / manual count; unknown (no match; see candidates) and needs_amount do not count until fixed with edit_food. Returns the items and the day's totals so far.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fatNo
kcalNo
mealNo
nameNo
textNo
unitNo
carbsNo
gramsNo
amountNo
barcodeNo
food_idNo
proteinNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden. It discloses how text is split and matched to USDA/Open Food Facts, the per-item statuses, that unknown and needs_amount items do not count until fixed with edit_food, and that it returns items plus day totals. This is unusually transparent.

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 dense but every sentence earns its place. It is front-loaded with the main usage pattern, then covers structured input, macros, meal defaults, item statuses, and the return value in a logical order. Nothing is filler.

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?

Given the tool's complexity, 12 parameters, no output schema, and no annotations, this description is remarkably complete. It covers all input modes, parameter combinations, units, meal defaults, status semantics, and the return shape. An agent has enough information to call it correctly in most real scenarios.

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 schema has 0% description coverage, but the description compensates completely by explaining every parameter: text, name, barcode, food_id, grams, amount, unit, kcal, protein, carbs, fat, and meal. It even gives examples of valid units and when to use each parameter.

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 opens with a specific action, 'Log food,' and immediately explains the main use case. It clearly distinguishes this tool from siblings like lookup_food and edit_food by pointing to them explicitly, so an agent can tell exactly what log_food does.

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

Usage Guidelines4/5

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

The description gives explicit usage guidance: pass natural-language text, or use structured fields like name/barcode/food_id with grams or amount+unit, and pass macros when reading a label. It also documents meal options and defaults. It does not explicitly state when not to use this tool in favor of log_set or other siblings, so it stops just short of a 5.

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