Repository navigation
Add delete_recipe tool for recipes and saved meals - #72
Open
paultristanwagner wants to merge 2 commits into
Open
paultristanwagner wants to merge 2 commits into
paultristanwagner wants to merge 2 commits into
Conversation
The app deletes foods through /api/v2/del_food. With retire: true (the default here) a recipe or meal leaves search and the My Foods lists while diary entries that logged it are kept. Without the flag the server deletes it outright, along with every diary entry that logged it, so that path is behind permanent=True and the tool description warns about it. Claude-Session: https://claude.ai/code/session_01MCJFDo71qoSqTRtcGfkpXJ
9 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #73.
Recipes and saved meals can now be deleted.
delete_custom_foodrefusesthem, and the client's own docstring noted that the app deletes foods
through an endpoint the client didn't know. That endpoint is
POST /api/v2/del_food:{"id": <food_id>, "retire": true, "auth": {…}, "config": {"call_version": 1}}retireis optional. Verified against the live API with throwawayrecipes:
retire: truethe recipe leaves search and theget_myfoodsrecipe/meal lists, stays readable by id, and a diary entry that logged
it is kept. The app sends this when you delete a meal that is already
logged.
get_foodthen answers "not found"), and the diary entry that logged it is
gone too. The app follows that with
POST /api/v2/delete_recent_foods{"servingFoodIds": [id]}."meal": true) behave the same way.Changes:
delete_recipe(food_id, *, permanent=False). It fetchesthe food under the per-food lock and refuses anything that isn't a
user-created recipe or meal (
source == "Custom"withingredients).It retires by default;
permanent=Truedeletes outright and clearsthe recent-foods entry.
delete_recipetool (destructive). Its descriptionwarns that
permanent=Trueremoves the diary entries that logged therecipe.
retire_custom_food's docstring no longer says the delete endpointis unknown.
Plain custom foods keep going through
delete_custom_foodas before.Moving them to
del_foodwould be a follow-up if you want it.https://claude.ai/code/session_01MCJFDo71qoSqTRtcGfkpXJ