feat(meal-planner): add add_recipe_to_meal_plan tool (v0.11.0)

New write tool using mpcreateByRecipeId endpoint (parameters verified
from JS-bundle). Returns raw response pending production verification;
structured output planned for v0.11.1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-17 11:45:28 +02:00
parent bf086a4f84
commit e7e242151f
6 changed files with 67 additions and 6 deletions
+4 -2
View File
@@ -24,7 +24,7 @@ und wird in Claude Desktop eingebunden.
## Aktueller Stand ## Aktueller Stand
### Implementierte Tools (v0.10.3) ### Implementierte Tools (v0.11.0)
| Kategorie | Tools | | Kategorie | Tools |
|---|---| |---|---|
@@ -34,6 +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` |
| Kreise | `create_circle`, `update_circle`, `delete_circle`, `add_member_to_circle` | | Kreise | `create_circle`, `update_circle`, `delete_circle`, `add_member_to_circle` |
## Roadmap ## Roadmap
@@ -61,7 +62,8 @@ und wird in Claude Desktop eingebunden.
- v0.10.0: get_meal_plan (read-only, raw JSON; Premium-Feature Essensplaner) ✓ - v0.10.0: get_meal_plan (read-only, raw JSON; Premium-Feature Essensplaner) ✓
- v0.10.1: get_meal_plan strukturierter Output + SPEC.md mplistinterval Response verifiziert ✓ - v0.10.1: get_meal_plan strukturierter Output + SPEC.md mplistinterval Response verifiziert ✓
- v0.10.2: get_meal_plan mealList[] einbinden (Freitext-Notizen + Portionen), merged + sortiert ✓ - v0.10.2: get_meal_plan mealList[] einbinden (Freitext-Notizen + Portionen), merged + sortiert ✓
- v0.10.3: get_meal_plan is_from_recipe_box Feld (recipeList[].isRecipe Lookup) ✓ ← aktuell - v0.10.3: get_meal_plan is_from_recipe_box Feld (recipeList[].isRecipe Lookup) ✓
- v0.11.0: add_recipe_to_meal_plan (mpcreateByRecipeId; raw response bis Struktur verifiziert) ✓ ← 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.10.3) ## Features (v0.11.0)
### Read ### Read
@@ -32,6 +32,7 @@ MCP server for [Family Wall](https://www.familywall.com) -- read and manage your
- `create_recipe` -- create a new recipe (name, description, ingredients, instructions, prep/cook time, serves, url, category_ids); use `\n` to separate ingredient lines - `create_recipe` -- create a new recipe (name, description, ingredients, instructions, prep/cook time, serves, url, category_ids); use `\n` to separate ingredient lines
- `update_recipe` -- update any field of an existing recipe (partial update — omitted fields unchanged; supports `category_ids` list to change categories) - `update_recipe` -- update any field of an existing recipe (partial update — omitted fields unchanged; supports `category_ids` list to change categories)
- `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)
- `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)
+16 -1
View File
@@ -722,12 +722,27 @@ Rezept-Details bei Bedarf separat via `get_recipe` abrufen.
**Verifiziert am:** 2026-04-17 via FW_DEBUG=1 **Verifiziert am:** 2026-04-17 via FW_DEBUG=1
### `mpcreateByRecipeId` Rezept in Essensplan eintragen
POST https://api.familywall.com/api/mpcreateByRecipeId
**Body-Parameter (verifiziert aus JS-Bundle startupmodule.js):**
| Parameter | Pflicht | Wert |
|---|---|---|
| `recipeId` | ja | Rezept-metaId (z.B. `"recipe/16282169_7932720"`) |
| `date` | ja | Ziel-Datum ISO 8601 (z.B. `"2026-04-20"`) |
| `type` | ja | Mahlzeiten-Typ: `BREAKFAST`, `LUNCH`, `SNACK`, `DINNER` |
| `clientOpId` | nein | Optionale Client-seitige Idempotenz-ID (wird weggelassen) |
**Response-Struktur:** TBD — Tool liefert Raw JSON zur Verifizierung (→ v0.11.1).
**Verifiziert am:** 2026-04-17 (Parameter aus JS-Bundle; Response TBD)
### Weitere Meal Planner Endpoints (nicht implementiert) ### Weitere Meal Planner Endpoints (nicht implementiert)
| Endpoint | Parameter | Bedeutung | | Endpoint | Parameter | Bedeutung |
|---|---|---| |---|---|---|
| `mpcreate` | `name`, `date`, `type`, `clientOpId` | Mahlzeit mit freiem Text erstellen | | `mpcreate` | `name`, `date`, `type`, `clientOpId` | Mahlzeit mit freiem Text erstellen |
| `mpcreateByRecipeId` | `recipeId`, `date`, `type`, `clientOpId` | Mahlzeit aus Rezept erstellen |
| `mpmealput` | Mahlzeiten-Objekt (encoded) | Mahlzeit aktualisieren | | `mpmealput` | Mahlzeiten-Objekt (encoded) | Mahlzeit aktualisieren |
| `mpmove` | `metaId`, `date`, `type`, `clientOpId` | Mahlzeit zu anderem Datum/Typ verschieben | | `mpmove` | `metaId`, `date`, `type`, `clientOpId` | Mahlzeit zu anderem Datum/Typ verschieben |
| `mpdelete` | `metaId` | Mahlzeit löschen | | `mpdelete` | `metaId` | Mahlzeit löschen |
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project] [project]
name = "mcp-familywall" name = "mcp-familywall"
version = "0.10.3" version = "0.11.0"
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.10.3" __version__ = "0.11.0"
+43
View File
@@ -2320,6 +2320,49 @@ def get_meal_plan(date_from: str, date_to: str) -> str:
return json.dumps(result, ensure_ascii=False, indent=2) return json.dumps(result, ensure_ascii=False, indent=2)
# ---------------------------------------------------------------------------
# Tool: add_recipe_to_meal_plan
# ---------------------------------------------------------------------------
@mcp.tool()
def add_recipe_to_meal_plan(
recipe_id: str,
date: str,
meal_type: str,
) -> str:
"""Add a recipe from the recipe box to the meal plan.
IMPORTANT: Ask the user for confirmation before calling this tool.
Args:
recipe_id: Recipe metaId from get_recipes
(e.g. ``"recipe/16282169_7932720"``).
date: Target date in ISO format (e.g. ``"2026-04-20"``).
meal_type: Meal slot — one of ``"BREAKFAST"``, ``"LUNCH"``,
``"SNACK"``, or ``"DINNER"``.
Returns:
JSON with the new dish entry on success, or an error message.
"""
if meal_type not in ("BREAKFAST", "LUNCH", "SNACK", "DINNER"):
return "Error: meal_type must be one of 'BREAKFAST', 'LUNCH', 'SNACK', 'DINNER'."
params: dict[str, Any] = {
"recipeId": recipe_id,
"date": date,
"type": meal_type,
}
try:
data = _authenticated_call("mpcreateByRecipeId", params)
except RuntimeError as exc:
return f"Error: {exc}"
# Return raw response until the structure is verified in production.
return json.dumps(data, ensure_ascii=False, indent=2)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Factory # Factory
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------