Search Foods
search_foodsSearch Nutriely's food catalog and the user's own foods. name uses the same search as the app, so it handles typos, word order and accents: "adazu tomato" finds "Chips, Tomato, ĀDAŽU". Combine it with barcode, category or nutrient conditions in filters, or use those on their own.
Food names are in English: translate name to English first, whatever language the user speaks, and keep brands as printed. A name in another language can find nothing, or something unrelated: "sel" (French for salt) finds "Selenium".
filters is a condition tree:
Nutrient: {"kind": "nutrient", "code": "FE", "operator": ">", "value": 3} (nutrient codes as in the components list; operators =, !=, >, >=, <, <=, plus "missing"/"present" with no value)
Food field: {"kind": "field", "field": "categoryCode", "operator": "=", "value": "VEGFRESH"}
Group: {"group": "and", "conditions": [node, node]} ("and" or "or", nestable)
Generic and restaurant foods: search the food itself, without the brand or restaurant ("french fries", not "Hesburger fries"), and log the catalog's generic version. When a specific name finds nothing ("ribeye"), search the broader food ("beef steak") or its category: the closest catalog foods are the next step, not a web search. No match for a composed dish or sauce means it can be built from its ingredients as a recipe, not that it's missing.
Foods with the same variant.group are versions of one food, like raw and boiled, or a cheese's fat levels. is_default marks the usual version.
Values are per the food's serving size. Energy (ENERC) is in kJ: divide by 4.184 for kcal, which US labels and users call calories. Use minimal for short lists of ids and names.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "search_foods"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | What to search for, in English, as you would type it in the app. | |
| type | No | Filter by type. | |
| limit | No | Page size. | |
| offset | No | Skip this many results. | |
| barcode | No | Exact barcode. | |
| filters | No | Condition tree, see the tool description. | |
| minimal | No | Return only id, name, type and category. | |
| category_code | No | Category code from list_categories. |