From 500ad278a49b43e11bf4a78f2ec3c961647850d6 Mon Sep 17 00:00:00 2001 From: Marcus van Elst Date: Fri, 17 Apr 2026 11:03:48 +0200 Subject: [PATCH] feat(meal-planner): add get_meal_plan read-only tool (v0.10.0) - Implement get_meal_plan() tool for accessing Family Wall meal planner - Parameters: date_from, date_to (ISO 8601 format) - Returns raw JSON for initial verification via FW_DEBUG=1 - Response structure to be verified in first deployment - Add Meal Planner API section to SPEC.md documenting mplistinterval and other endpoints - Update version to 0.10.0 in __init__.py and pyproject.toml - Update README.md and CLAUDE.md with tool info and roadmap Co-Authored-By: Claude Haiku 4.5 --- CLAUDE.md | 7 +++--- README.md | 3 ++- SPEC.md | 42 ++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- src/mcp_familywall/__init__.py | 2 +- src/mcp_familywall/server.py | 25 ++++++++++++++++++++ 6 files changed, 75 insertions(+), 6 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index cc90a5b..39dd777 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -24,11 +24,11 @@ und wird in Claude Desktop eingebunden. ## Aktueller Stand -### Implementierte Tools (v0.9.1) +### Implementierte Tools (v0.10.0) | Kategorie | Tools | |---|---| -| Lesen | `get_circles`, `get_members`, `get_lists`, `get_tasks`, `get_categories`, `get_activities` | +| Lesen | `get_circles`, `get_members`, `get_lists`, `get_tasks`, `get_categories`, `get_activities`, `get_meal_plan` | | Tasks | `create_task`, `update_task`, `toggle_task`, `delete_task` | | Listen | `create_list`, `update_list`, `delete_list` | | Kategorien | `create_category`, `delete_category` | @@ -57,7 +57,8 @@ und wird in Claude Desktop eingebunden. - v0.8.3: OTHER-Listentyp dokumentiert + create_list unterstützt ihn; FW_DEBUG=1 loggt unbekannte Task-Felder (Vorbereitung Wiederholungen) ✓ - v0.8.x: mpadditemtolist (gestrichen – Family Wall kann das nativ) - v0.9.0: get_tasks liefert recurrency, recurrency_interval, rrule, reminder (read-only) ✓ -- v0.9.1: Bugfix reminder-Mapping (reminderUnit/reminderValue statt unit/value; value=0 ist gültig) ✓ ← aktuell +- v0.9.1: Bugfix reminder-Mapping (reminderUnit/reminderValue statt unit/value; value=0 ist gültig) ✓ +- v0.10.0: get_meal_plan (read-only, raw JSON; Premium-Feature Essensplaner) ✓ ← aktuell - v2.0: Schreibzugriff auf Wall-Posts (Erstellen, Kommentieren) diff --git a/README.md b/README.md index 23b4bea..0b21420 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.9.1) +## Features (v0.10.0) ### Read @@ -15,6 +15,7 @@ MCP server for [Family Wall](https://www.familywall.com) -- read and manage your - `get_recipes` -- list all family recipes (compact summary: id, name, prep/cook time, serves) - `get_recipe` -- get a single recipe in full detail (ingredients, instructions, ingredients_parsed, category_ids, etc.) - `get_recipe_categories` -- list all available recipe categories (always returns all 5 standard categories: Bei Kindern beliebt, Wirklich einfach, Nachspeisen, Schmeckt toll, Gemüse; plus any additional categories found in existing recipes) +- `get_meal_plan` -- get meal plan entries for a date range (Premium feature; returns raw JSON for verification) ### Write (with confirmation prompt) diff --git a/SPEC.md b/SPEC.md index 4c2e198..9aa6dac 100644 --- a/SPEC.md +++ b/SPEC.md @@ -664,6 +664,48 @@ Löscht einen Kreis und alle zugehörigen Inhalte (Listen, Tasks, Rezepte, Wall- **Verifiziert am:** 2026-04-16 via FW_DEBUG=1 (family/23447371 erfolgreich gelöscht) +## Meal Planner API + +Premium-Feature. Endpoints extrahiert aus JS-Bundle `startupmodule.js?vfw=2026-04-03T140539`. +Browser-Analyse blockiert durch Service Worker. Response-Struktur wird nach erstem Deploy +mit `FW_DEBUG=1` verifiziert. + +### `mplistinterval` – Essensplan für Datumsbereich abrufen +POST https://api.familywall.com/api/mplistinterval + +**Body-Parameter:** + +| Parameter | Pflicht | Wert | +|---|---|---| +| `from` | ja | Start-Datum (ISO 8601, Format TBD: `"2026-04-13"` oder `"2026-04-13T00:00:00"`) | +| `to` | ja | End-Datum (ISO 8601, Format TBD) | + +**Response-Struktur:** TBD — Tool liefert Raw JSON zur Verifizierung. + +**Mahlzeiten-Typen:** +- `BREAKFAST` – Frühstück +- `LUNCH` – Mittagessen +- `SNACK` – Snack +- `DINNER` – Abendessen + +**Mahlzeiten-Objekt:** MetaId-Format `dish/` (Präfix "dish/"). + +**Verifiziert am:** 2026-04-17 (Endpoint-Name aus JS-Bundle, Response TBD) + +### Weitere Meal Planner Endpoints (nicht implementiert) + +| Endpoint | Parameter | Bedeutung | +|---|---|---| +| `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 | +| `mpmove` | `metaId`, `date`, `type`, `clientOpId` | Mahlzeit zu anderem Datum/Typ verschieben | +| `mpdelete` | `metaId` | Mahlzeit löschen | +| `mpsettings` | – | Einstellungen lesen | + +**Quelle:** JS-Bundle-Analyse (startupmodule.js). +**Status:** Endpunkte bekannt, Response-Struktur unbekannt. + ### Recipe Categories API Details Recipe categories are managed via `mprecipeput` endpoint. Each recipe can have zero or more diff --git a/pyproject.toml b/pyproject.toml index 1852c75..6e5fe7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "mcp-familywall" -version = "0.9.1" +version = "0.10.0" 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 d69d16e..61fb31c 100644 --- a/src/mcp_familywall/__init__.py +++ b/src/mcp_familywall/__init__.py @@ -1 +1 @@ -__version__ = "0.9.1" +__version__ = "0.10.0" diff --git a/src/mcp_familywall/server.py b/src/mcp_familywall/server.py index a444409..43d2727 100644 --- a/src/mcp_familywall/server.py +++ b/src/mcp_familywall/server.py @@ -2210,6 +2210,31 @@ def update_recipe( return json.dumps(result, ensure_ascii=False, indent=2) +# --------------------------------------------------------------------------- +# Tool: get_meal_plan +# --------------------------------------------------------------------------- + + +@mcp.tool() +def get_meal_plan(date_from: str, date_to: str) -> str: + """Return meal plan entries for a date range. + + Args: + date_from: Start date in ISO format (e.g. ``"2026-04-13"``). + date_to: End date in ISO format (e.g. ``"2026-04-19"``). + + Returns: + Raw JSON response from the API for initial verification. + """ + try: + data = _authenticated_call("mplistinterval", {"from": date_from, "to": date_to}) + except RuntimeError as exc: + return f"Error: {exc}" + + # Return raw JSON for verification — response structure not yet known + return json.dumps(data, ensure_ascii=False, indent=2) + + # --------------------------------------------------------------------------- # Factory # ---------------------------------------------------------------------------