joiva_log_food
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
| Name | Required | Description | Default |
|---|---|---|---|
| food | Yes | Food name, e.g. 'Haferflocken' | |
| meal | No | Meal 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. | |
| brand | No | Manufacturer/brand, e.g. 'Jarmino'. Keeps products with different label values apart | |
| grams | Yes | ||
| notiz | No | Short note on the preparation, e.g. 'selbst geröstet, 10 min 170 °C'. | |
| garung | No | How 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. | |
| mealId | No | Explicit grouping id; normally unnecessary, since `meal` groups automatically | |
| barcode | No | EAN/UPC digits. Links the food to Joiva's global product catalog | |
| subType | No | Variant, e.g. 'zart' | |
| loggedAt | No | ISO 8601 timestamp with offset, defaults to now | |
| unitCount | No | How many of that unit, e.g. 2 for 'zwei Eier M'. Only stored together with unitLabel. | |
| unitLabel | No | 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. | |
| behandlung | No | Pre-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. | |
| forceRefresh | No | Re-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. | |
| nutrientSource | No | Provenance 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. | |
| nutrientsPer100g | No |