Skip to main content
Glama

Save food to My foods

save_food
DestructiveIdempotent

Save a food to the user's My foods, usually from a photo of its nutrition label, so the label's numbers are used from now on (in the app's search and barcode scanner, and in lookup_barcode). Use it when the user asks to save or fix a food, or offer it after logging from a label because the database numbers were wrong. Convert the label to per 100 g (per 100 ml for drinks, unit 'ml'): a label giving 8.9 g protein per 50 g serve is 17.8 g per 100 g. Prefer the label's own per-100 g column when it has one. Put the label's serving in serving_size_g and serving_label. Include the barcode digits when the photo shows them: the user's version then replaces the shared product for them, and the Heza team gets the correction to fix it for everyone. Saving again with the same barcode (or the same name and brand) updates the user's version. The food stays private to the user. Returns food_id: log a portion with log_food_from_database (food_id + grams).

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": {
      "name": "<name>",
      "kcal_100g": "<kcal_100g>",
      "protein_100g": "<protein_100g>",
      "carbs_100g": "<carbs_100g>",
      "fat_100g": "<fat_100g>"
    },
    "name": "save_food"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesProduct name as on the pack, e.g. 'Manuka Honey Leg Ham'
unitNo'ml' for drinks (values per 100 ml), else 'g' (default)
brandNo
barcodeNoDigits of the barcode, when visible
fat_100gYes
favoriteNoAlso star it as a favorite
kcal_100gYeskcal per 100 g/ml (kJ / 4.184 when the label gives kJ)
carbs_100gYes
fiber_100gNo
sugar_100gNo
protein_100gYes
serving_labelNoHow the label names a serving, e.g. '2 slices (50 g)'
serving_size_gNoOne serving in g (or ml), from the label
sodium_mg_100gNo

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?

Goes well past the annotations: it discloses that the food stays private to the user, that supplying a barcode makes the user's version replace the shared product in their search and barcode lookup, that the Heza team receives the correction, and that re-saving with the same barcode or same name+brand updates rather than duplicates. That last point concretely explains the idempotentHint and the overwrite implied by destructiveHint, and the return value (food_id) plus next step are stated.

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 and every sentence carries an instruction or a behavioral fact; the conversion example earns its space. It is dense but long for a single tool, and the parenthetical about search/barcode scope could be tightened, which keeps it just below the top score.

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 14-parameter mutation with no output schema, the description covers the missing pieces: normalization of inputs, serving metadata, barcode semantics, overwrite behavior, privacy, and the returned food_id with the follow-up logging call. An agent could call this correctly without further context.

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?

With 14 params at 50% schema coverage, the description carries real weight: it supplies the per-100 g normalization rule with a worked example (8.9 g per 50 g serve → 17.8 g per 100 g), the 'ml for drinks' unit rule, what belongs in serving_size_g and serving_label, and when to include barcode digits. It leaves the optional micro-nutrients (fiber, sugar, sodium) and favorite/brand unexplained, but those are largely self-evident from the schema.

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 (save a food to the user's My foods) and frames the trigger (usually from a nutrition-label photo). It is clearly distinguished from siblings by naming lookup_barcode and log_food_from_database and explaining how each relates to this tool.

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?

Explicit when-to-use: 'when the user asks to save or fix a food, or offer it after logging from a label because the database numbers were wrong.' It also gives a decision rule for ambiguous input ('prefer the label's own per-100 g column when it has one') and points to the follow-up sibling for logging.

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