Loki Docs
Tools › Foods › Search foods

Search foods

search_foodsReads
What it does
Reads only. Changes nothing. Reaches an outside service.
Permission
Foods, read foods:read

What your assistant is told

Search foods by name, in three tiers: first the user's OWN foods (the ones they eat, most used first), then the shared catalog, and only if those barely matched, live Open Food Facts. Each result has a stable id you pass to log_meal as food_id, macros PER 100 g, and is_mine / use_count / last_used_at saying whether it is one of theirs and how they use it. PREFER A FOOD THEY ALREADY EAT, and say which one you picked — "logged it as your Bonduelle sweet corn" — so a wrong match is visible instead of silent. If you only need their own foods, call list_my_ingredients instead; reach past theirs only when nothing of theirs matches. Data from Open Food Facts is ODbL-licensed — attribute it if you surface the source. For a photo you estimated yourself, pass macros inline to log_meal.

Parameters

  • querytext, requiredName fragment to search for, e.g. "greek yogurt".
  • localetext, optionalOptional ISO locale hint, e.g. "en" or "fr".
  • limitwhole number, optionalMax results (default 20, capped at 50).