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 <noreply@anthropic.com>
This commit is contained in:
2026-04-17 12:28:41 +02:00
parent a26a637c83
commit e0054116cb
6 changed files with 51 additions and 8 deletions
+4 -3
View File
@@ -24,7 +24,7 @@ und wird in Claude Desktop eingebunden.
## Aktueller Stand ## Aktueller Stand
### Implementierte Tools (v0.11.3) ### Implementierte Tools (v0.11.4)
| Kategorie | Tools | | Kategorie | Tools |
|---|---| |---|---|
@@ -34,7 +34,7 @@ und wird in Claude Desktop eingebunden.
| Kategorien | `create_category`, `delete_category` | | Kategorien | `create_category`, `delete_category` |
| Aktivitäten | `like_post` | | Aktivitäten | `like_post` |
| Rezepte | `get_recipes`, `get_recipe`, `create_recipe`, `update_recipe`, `delete_recipe`, `get_recipe_categories` | | 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` | | Kreise | `create_circle`, `update_circle`, `delete_circle`, `add_member_to_circle` |
## Roadmap ## 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.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.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.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) - v2.0: Schreibzugriff auf Wall-Posts (Erstellen, Kommentieren)
+2 -1
View File
@@ -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. 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 ### 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) - `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_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 - `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) - `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) - `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) - `delete_circle` -- permanently delete a circle and all its content (primary circle is protected)
+7 -2
View File
@@ -216,14 +216,19 @@ POST https://api.familywall.com/api/taskmark
a00.r.r → Task-Objekt mit lastAction: "MARK_COMPLETED" 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 POST https://api.familywall.com/api/metadelete
**Body-Parameter:** **Body-Parameter:**
| Parameter | Wert | | Parameter | Wert |
|---|---| |---|---|
| `id` | Task-metaId ⚠️ nicht `metaId`! | | `id` | metaId des zu löschenden Objekts ⚠️ nicht `metaId`! |
**Unterstützte Objekt-Typen:**
- Tasks: `task/<id>`
- Rezepte: `recipe/<id>`
- Essensplan-Einträge: `dish/<id>` und `meal/<id>`
**Response:** **Response:**
``` ```
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project] [project]
name = "mcp-familywall" 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" description = "MCP server for Family Wall — read your family's lists and tasks via Claude"
readme = "README.md" readme = "README.md"
requires-python = ">=3.12" requires-python = ">=3.12"
+1 -1
View File
@@ -1 +1 @@
__version__ = "0.11.3" __version__ = "0.11.4"
+36
View File
@@ -2463,6 +2463,42 @@ def add_meal_to_meal_plan(
return json.dumps(result, ensure_ascii=False, indent=2) 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 # Factory
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------