From e0054116cbdedc47d74a38f7fd521b60a13833e2 Mon Sep 17 00:00:00 2001 From: Marcus van Elst Date: Fri, 17 Apr 2026 12:28:41 +0200 Subject: [PATCH] feat(meal-planner): add delete_meal_plan_entry tool (v0.11.4) Reuses the existing metadelete endpoint (already used for tasks and recipes). Validates that entry_id starts with 'dish/' or 'meal/' before calling the API. SPEC.md updated to reflect metadelete's broader scope. Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 7 ++++--- README.md | 3 ++- SPEC.md | 9 +++++++-- pyproject.toml | 2 +- src/mcp_familywall/__init__.py | 2 +- src/mcp_familywall/server.py | 36 ++++++++++++++++++++++++++++++++++ 6 files changed, 51 insertions(+), 8 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 86b98f3..e45ed77 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -24,7 +24,7 @@ und wird in Claude Desktop eingebunden. ## Aktueller Stand -### Implementierte Tools (v0.11.3) +### Implementierte Tools (v0.11.4) | Kategorie | Tools | |---|---| @@ -34,7 +34,7 @@ und wird in Claude Desktop eingebunden. | Kategorien | `create_category`, `delete_category` | | Aktivitäten | `like_post` | | Rezepte | `get_recipes`, `get_recipe`, `create_recipe`, `update_recipe`, `delete_recipe`, `get_recipe_categories` | -| Essensplaner | `get_meal_plan`, `add_recipe_to_meal_plan`, `add_meal_to_meal_plan` | +| Essensplaner | `get_meal_plan`, `add_recipe_to_meal_plan`, `add_meal_to_meal_plan`, `delete_meal_plan_entry` | | Kreise | `create_circle`, `update_circle`, `delete_circle`, `add_member_to_circle` | ## Roadmap @@ -66,7 +66,8 @@ und wird in Claude Desktop eingebunden. - v0.11.0: add_recipe_to_meal_plan (mpcreateByRecipeId; raw response bis Struktur verifiziert) ✓ - v0.11.1: add_recipe_to_meal_plan strukturierter Output (Response verifiziert) ✓ - v0.11.2: add_meal_to_meal_plan (mpcreate; Freitext; raw response bis Struktur verifiziert) ✓ -- v0.11.3: add_meal_to_meal_plan strukturierter Output (a00.r.r ist Array, nicht Objekt) ✓ ← aktuell +- v0.11.3: add_meal_to_meal_plan strukturierter Output (a00.r.r ist Array, nicht Objekt) ✓ +- v0.11.4: delete_meal_plan_entry (metadelete für dish/ und meal/-Objekte) ✓ ← aktuell - v2.0: Schreibzugriff auf Wall-Posts (Erstellen, Kommentieren) diff --git a/README.md b/README.md index 3624117..e8ef05a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ MCP server for [Family Wall](https://www.familywall.com) -- read and manage your family's circles, lists, tasks, and recipes directly from Claude. -## Features (v0.11.3) +## Features (v0.11.4) ### Read @@ -34,6 +34,7 @@ MCP server for [Family Wall](https://www.familywall.com) -- read and manage your - `delete_recipe` -- permanently delete a recipe (only own recipes) - `add_recipe_to_meal_plan` -- add a recipe from the recipe box to the meal plan for a specific date and meal slot (BREAKFAST/LUNCH/SNACK/DINNER) - `add_meal_to_meal_plan` -- add a free-text meal entry (no recipe) to the meal plan for a specific date and meal slot +- `delete_meal_plan_entry` -- permanently delete a meal plan entry (works for both `dish/…` and `meal/…` entries) - `create_circle` -- create a new Family Wall circle (group) - `update_circle` -- rename a circle (server capitalises first letter; only name is changeable via API; primary circle is protected) - `delete_circle` -- permanently delete a circle and all its content (primary circle is protected) diff --git a/SPEC.md b/SPEC.md index 59cc599..1a8edd3 100644 --- a/SPEC.md +++ b/SPEC.md @@ -216,14 +216,19 @@ POST https://api.familywall.com/api/taskmark a00.r.r → Task-Objekt mit lastAction: "MARK_COMPLETED" ``` -### `metadelete` – Task löschen +### `metadelete` – Objekt löschen (Task, Rezept, Essensplan-Eintrag) POST https://api.familywall.com/api/metadelete **Body-Parameter:** | Parameter | Wert | |---|---| -| `id` | Task-metaId ⚠️ nicht `metaId`! | +| `id` | metaId des zu löschenden Objekts ⚠️ nicht `metaId`! | + +**Unterstützte Objekt-Typen:** +- Tasks: `task/` +- Rezepte: `recipe/` +- Essensplan-Einträge: `dish/` und `meal/` **Response:** ``` diff --git a/pyproject.toml b/pyproject.toml index 0fb0913..820d26e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "mcp-familywall" -version = "0.11.3" +version = "0.11.4" description = "MCP server for Family Wall — read your family's lists and tasks via Claude" readme = "README.md" requires-python = ">=3.12" diff --git a/src/mcp_familywall/__init__.py b/src/mcp_familywall/__init__.py index 1bebb74..350cbe9 100644 --- a/src/mcp_familywall/__init__.py +++ b/src/mcp_familywall/__init__.py @@ -1 +1 @@ -__version__ = "0.11.3" +__version__ = "0.11.4" diff --git a/src/mcp_familywall/server.py b/src/mcp_familywall/server.py index ce7e309..98daacd 100644 --- a/src/mcp_familywall/server.py +++ b/src/mcp_familywall/server.py @@ -2463,6 +2463,42 @@ def add_meal_to_meal_plan( return json.dumps(result, ensure_ascii=False, indent=2) +# --------------------------------------------------------------------------- +# Tool: delete_meal_plan_entry +# --------------------------------------------------------------------------- + + +@mcp.tool() +def delete_meal_plan_entry(entry_id: str) -> str: + """Permanently delete a meal plan entry (dish or meal). + + IMPORTANT: Ask the user for confirmation before calling this tool. + + Works for both ``dish/...`` entries (planned meals/recipes) and + ``meal/...`` entries (notes/servings). Use ``get_meal_plan`` to + retrieve entry IDs. + + Args: + entry_id: Entry metaId from get_meal_plan + (e.g. ``"dish/16282169_20009811"`` or ``"meal/16282169_1620659"``). + + Returns: + JSON success indicator or an error message. + """ + if not entry_id.startswith(("dish/", "meal/")): + return ( + "Error: entry_id must be a dish or meal metaId " + "(e.g. 'dish/16282169_20009811' or 'meal/16282169_1620659')." + ) + + try: + _authenticated_call("metadelete", {"id": entry_id}) + except RuntimeError as exc: + return f"Error: {exc}" + + return json.dumps({"deleted": True, "id": entry_id}, ensure_ascii=False, indent=2) + + # --------------------------------------------------------------------------- # Factory # ---------------------------------------------------------------------------