Save food or recipe
save_foodSave a food or recipe to My foods, or with id update one of the person's foods. Search list_foods first and save a new food only when nothing matches, never for a product the catalogue already has. Each recipe ingredient is a food from list_foods or, only when nothing matches, a newFood, with a portion; the server adds up the nutrition. When changing a shared or saved food, pass copyFrom so its origin is kept: a product change goes to review and does not change the shared catalogue directly. Meals and recipes keep the version they were saved with. Pass photos the person attached as photos.
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": {
"name": "<name>",
"data": "<data>"
},
"name": "save_food"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | To update one of the person's own foods: its key from list_foods with library mine. Leave out to save a new food. | |
| data | Yes | What the food is: its base unit, nutrition and measures, and for a recipe its ingredients and steps | |
| name | Yes | The food's name, without its brand | |
| brand | No | The brand, for a packaged or restaurant food | |
| photos | No | Photos the person attached in this conversation to keep with this record: pass the attachments themselves, never file paths | |
| barcode | No | The EAN or UPC barcode digits from the package | |
| copyFrom | No | The food this one was changed from, so its provenance is kept and a product correction can be proposed. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | ||
| data | Yes | ||
| name | Yes | ||
| brand | Yes | ||
| barcode | Yes | ||
| library | Yes | ||
| version | Yes | ||
| sourceKey | No | ||
| sourceLibrary | No |