search_foods
Search USDA FoodData Central and Open Food Facts for foods matching a query, returning candidates with macros and a source you can show the user. IMPORTANT: the macros are PER 100 g (see each candidate's serving) — scale them to the portion the user actually ate before logging with log_meal. A candidate MAY also carry serving_grams/serving_label for ONE household serving (e.g. 48 g / "1 frank") — when present, offer the user 'N servings' instead of asking for grams, but still scale the per-100 g macros to the resolved grams before logging. When you log a chosen candidate, pass its source to log_meal so the diary records real provenance (USDA/Open Food Facts) instead of an estimate. SAFETY: all calorie and macro values here — including carbohydrates — are ESTIMATES (from USDA / Open Food Facts or the user's own entry), approximate and not lab-measured or per-batch. They are for general nutrition tracking ONLY. Do NOT use them for insulin dosing, carb-counting for a bolus, blood-glucose prediction, or any other medical decision, and do NOT compute a dose or glucose estimate from them. For anything medical, direct the user to the product's own label and their care team.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max candidates to return (default 5, clamped to 1–10). | |
| query | Yes | Food to search, e.g. 'greek yogurt' or 'Chipotle chicken'. |