Use this when you have researched a new food that you didn't find in the database, or you have researched nutrient values a food lacks (its notYetResearched fields from get_food_nutrients) or better ones. To extend or correct a food, send the food id (or null if this is a new food) and only the new or corrected values. Only upload foods, not recipes. Saves publicly; a repeated call adds a revision. Never include personal information.
Research each value on its own; never fill a batch of fields with one default. Send only the fields you researched; a food may stay partial.
1. Name each field as get_food_nutrients lists it in notYetResearched, e.g. "Protein", and give its amount in the unit listed with it; for a new food, call get_food_nutrients with its name and detail "complete" to list every field. Values are per 100 g edible food, in that unit.
2. reported: read from a source for this exact food (species, variety, ripeness, part, preparation): food composition tables (USDA FoodData Central SR Legacy or Survey, UK CoFID, French CIQUAL, AUSNUT, Canadian Nutrient File), labels, or peer-reviewed analyses. Check the column heading, units, and basis before converting; scaling a label serving to 100 g is still reported. Cite its source indexes.
3. imputed: any value you estimated or calculated yourself, from the closest comparable foods or a relationship to values the food already has (a fatty acid as a share of total fat, an amino acid as a share of protein). Give a method, inputs naming the foods, ratios, and assumptions, and an uncertainty {low, high} that contains the amount and reflects the real spread, not a token range. Bounds are descriptive, not confidence intervals.
4. Use zero only with evidence the component is absent from this food, with bounds like any estimate. Fields marked usuallyAbsent are absent from most foods but never assumed: for each one this food cannot contain, report zero as an imputed value that says why; leave the rest for research (tea, citrus, soy, mushrooms, wine, chocolate, fortified products...).
5. Leave fields marked serverDerives to the server; only the server marks values derived. Components may not exceed their totals, alternative methods for one quantity must broadly agree, and energy must fit the protein, fat, carbohydrate, alcohol, and acetic acid. Totals overlap their components, and neither total fat nor protein is the sum of its listed components.
6. Add every source you actually read to sources, and cite the indexes each value rests on.
7. Attribute every estimate with imputation {model, provider, service, generatedAt, reasoningEffort?}, once for the whole write: your model name as you know it, with its version if known (for example GPT-6 or claude-fable-5-1), the company serving you, the product or API you run in, and the time. Add reasoningEffort only if your host tells you. Never invent any of them.
8. If a quantity you need is a volume or household measure the food lacks (a cup, a tablespoon, a slice), add it to portions with its weight in grams: reported if a source states it, otherwise imputed, with bounds in grams, as in rules 3 and 7. One volume portion converts every volume unit. Give its form when the weight depends on it (sifted, packed, chopped, mashed); cooked or raw is a different food, not a form.
set_food_nutrients