Skip to main content
Glama

joiva_log_food

Destructive

Log ONE food the signed-in user ate in Joiva, as one entry. Takes the food name in the user's own language; Joiva resolves the nutrient values itself against its reference sources and reports their provenance in the nutrients field of the response. Reuses an existing food by barcode or (food, subType, brand), otherwise creates it. brand and barcode decide which product is meant. Several foods of one meal are several entries with the same meal. A dish or a food with additions (oil, butter, sauce) in one entry, or ingredients and nutrient values in notiz, are refused with an explanation, and nothing is written. Time defaults to now.

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": {
      "food": "<food>",
      "grams": "<grams>"
    },
    "name": "joiva_log_food"
  }
}

Input Schema

NameRequiredDescriptionDefault
foodYesFood name, e.g. 'Haferflocken'
mealNoMeal slot by name, e.g. 'Frühstück'. Entries logged for the same day as the entry (not 'today') and the same slot join the existing group instead of forming a second one, so a late addition for yesterday does not land in today's breakfast. Unlike mealId, it needs no lookup. Exception 'Snack': a day can have several snacks, so a snack only joins a snack logged within about an hour of it; a later one becomes its own meal and is sorted by its time.
brandNoManufacturer/brand, e.g. 'Jarmino'. Keeps products with different label values apart
gramsYes
notizNoShort note on the preparation, e.g. 'selbst geröstet, 10 min 170 °C'.
garungNoHow it was prepared when eaten, exactly one of: roh, gekocht, gedämpft, gebacken, geröstet, gebraten, gegrillt. Not given = as bought (the product's own state is copied); null = clear. Joiva re-derives the values: a measured BLS variant first (e.g. roasted hazelnuts), else documented USDA retention factors; otherwise the entry reports that the preparation is not accounted for.
mealIdNoExplicit grouping id; normally unnecessary, since `meal` groups automatically
barcodeNoEAN/UPC digits. Links the food to Joiva's global product catalog
subTypeNoVariant, e.g. 'zart'
loggedAtNoISO 8601 timestamp with offset, defaults to now
unitCountNoHow many of that unit, e.g. 2 for 'zwei Eier M'. Only stored together with unitLabel.
unitLabelNoHow the amount was meant, e.g. 'Ei M', 'Scheibe', 'EL'. Display only: `grams` stays mandatory and remains the stored amount, so both are given. Labels that match a food's existing `portions` (name and gram weight, as listed in the food catalog) reuse that portion. Not needed when the user gave a weight.
behandlungNoPre-treatments, any of: eingeweicht, gekeimt, fermentiert, geräuchert, gepökelt (e.g. soaked AND roasted nuts = behandlung ['eingeweicht'] + garung 'geröstet'). Not given = as bought; [] = none.
forceRefreshNoRe-resolve the catalog entry against the reference databases although it already exists, for stored values that are wrong or were estimated while no source answered ('die Nährwerte für Ei stimmen nicht'). Leaves values alone that the user dictated or that were read off a label.
nutrientSourceNoProvenance of nutrientsPer100g: 'label' when read literally off the product's printed per-100g nutrition table (e.g. from a photo the user shared), 'user' when the user dictated exact values; absent for estimates. Higher provenance upgrades the stored food item.
nutrientsPer100gNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / unitLabel / description
      Previous value: -"How the amount was meant, e.g. 'Ei M', 'Scheibe', 'EL'. Display only: `grams` stays mandatory and remains the stored amount, so both are given. Labels from a food's `portions` (returned by joiva_search_foods and joiva_list_frequent_foods with their gram weight) match existing portions. Not needed when the user gave a weight."New value: +"How the amount was meant, e.g. 'Ei M', 'Scheibe', 'EL'. Display only: `grams` stays mandatory and remains the stored amount, so both are given. Labels that match a food's existing `portions` (name and gram weight, as listed in the food catalog) reuse that portion. Not needed when the user gave a weight."
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and non-idempotent, and the description adds meaningful context beyond them: refusal behavior with an explanation and 'nothing is written', reuse of an existing catalog food by barcode or (food, subType, brand) versus creating a new one, and provenance reporting in the response's `nutrients` field. It stops short of spelling out the side effect that matters most for a destructive tool, namely that a new food item may be created in the user's catalog when no match is found.

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 clause and every subsequent sentence carries a distinct constraint: resolution, reuse, grouping, refusals, time default. It is dense and sentence two is long, but no sentence is wasted and nothing is repeated from the schema verbatim.

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

Completeness4/5

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

For a 16-parameter mutation tool with no output schema, the description covers the crucial semantics: single-food scope, reuse versus create, grouping, refusal cases, and provenance of returned nutrients. The main omission is any description of the response shape beyond the `nutrients` field and the indication that preparation may be flagged as not accounted for in `garung`.

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 already 88%, and the description still adds interpretation the schema cannot: `brand` and `barcode` decide which product is meant, the food name may be in the user's own language, `meal` grouping (same day plus same slot) governs several entries, `notiz` must not carry ingredients or nutrient values, and time defaults to now. That is genuine added meaning rather than restatement.

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 opening sentence gives a specific verb and resource ('Log ONE food ... as one entry') and the emphasis on ONE distinguishes it from joiva_log_meal and joiva_log_described_meal. It also pre-empts the most likely confusion by stating that several foods of one meal are several entries with the same `meal`.

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?

It clearly conveys when not to use it: dishes, foods with additions (oil, butter, sauce) and entries carrying ingredients or nutrient values in `notiz` are refused, so the agent knows to redirect those cases. It also explains multi-food handling and the reuse-vs-create path. The gap is that it never names the sibling tool to use instead (joiva_log_meal, joiva_log_described_meal), leaving the agent to infer the alternative.

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