feat(meal-planner): add add_meal_to_meal_plan tool (v0.11.2)
New write tool using mpcreate endpoint for free-text meal entries (no recipe link). Parameters verified from JS-bundle. Returns raw response pending production verification; structured output → v0.11.3. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,7 +24,7 @@ und wird in Claude Desktop eingebunden.
|
||||
|
||||
## Aktueller Stand
|
||||
|
||||
### Implementierte Tools (v0.11.1)
|
||||
### Implementierte Tools (v0.11.2)
|
||||
|
||||
| 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` |
|
||||
| Essensplaner | `get_meal_plan`, `add_recipe_to_meal_plan`, `add_meal_to_meal_plan` |
|
||||
| Kreise | `create_circle`, `update_circle`, `delete_circle`, `add_member_to_circle` |
|
||||
|
||||
## Roadmap
|
||||
@@ -64,7 +64,8 @@ und wird in Claude Desktop eingebunden.
|
||||
- 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) ✓
|
||||
- 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) ✓ ← aktuell
|
||||
- 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) ✓ ← aktuell
|
||||
- v2.0: Schreibzugriff auf Wall-Posts (Erstellen, Kommentieren)
|
||||
|
||||
|
||||
|
||||
@@ -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.1)
|
||||
## Features (v0.11.2)
|
||||
|
||||
### Read
|
||||
|
||||
@@ -33,6 +33,7 @@ MCP server for [Family Wall](https://www.familywall.com) -- read and manage your
|
||||
- `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)
|
||||
- `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
|
||||
- `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)
|
||||
|
||||
@@ -752,11 +752,27 @@ a00.cn → "mpcreateByRecipeId" (Endpoint-Echo)
|
||||
|
||||
**Verifiziert am:** 2026-04-17 via FW_DEBUG=1
|
||||
|
||||
### `mpcreate` – Freitext-Mahlzeit in Essensplan eintragen
|
||||
POST https://api.familywall.com/api/mpcreate
|
||||
|
||||
**Body-Parameter (verifiziert aus JS-Bundle startupmodule.js):**
|
||||
|
||||
| Parameter | Pflicht | Wert |
|
||||
|---|---|---|
|
||||
| `name` | ja | Anzeigename der Mahlzeit (z.B. `"Pfannkuchen"`) |
|
||||
| `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.3).
|
||||
Erwartet: dish-Objekt analog zu `mpcreateByRecipeId`, aber ohne `recipeId`.
|
||||
|
||||
**Verifiziert am:** 2026-04-17 (Parameter aus JS-Bundle; Response TBD)
|
||||
|
||||
### Weitere Meal Planner Endpoints (nicht implementiert)
|
||||
|
||||
| Endpoint | Parameter | Bedeutung |
|
||||
|---|---|---|
|
||||
| `mpcreate` | `name`, `date`, `type`, `clientOpId` | Mahlzeit mit freiem Text erstellen |
|
||||
| `mpmealput` | Mahlzeiten-Objekt (encoded) | Mahlzeit aktualisieren |
|
||||
| `mpmove` | `metaId`, `date`, `type`, `clientOpId` | Mahlzeit zu anderem Datum/Typ verschieben |
|
||||
| `mpdelete` | `metaId` | Mahlzeit löschen |
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "mcp-familywall"
|
||||
version = "0.11.1"
|
||||
version = "0.11.2"
|
||||
description = "MCP server for Family Wall — read your family's lists and tasks via Claude"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = "0.11.1"
|
||||
__version__ = "0.11.2"
|
||||
|
||||
@@ -2387,6 +2387,53 @@ def add_recipe_to_meal_plan(
|
||||
return json.dumps(result, ensure_ascii=False, indent=2)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Tool: add_meal_to_meal_plan
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
def add_meal_to_meal_plan(
|
||||
name: str,
|
||||
date: str,
|
||||
meal_type: str,
|
||||
) -> str:
|
||||
"""Add a free-text meal entry to the meal plan.
|
||||
|
||||
IMPORTANT: Ask the user for confirmation before calling this tool.
|
||||
|
||||
Use this when the meal has no recipe in the recipe box.
|
||||
For meals from the recipe box use ``add_recipe_to_meal_plan`` instead.
|
||||
|
||||
Args:
|
||||
name: Display name of the meal (e.g. ``"Pfannkuchen"``).
|
||||
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'."
|
||||
if not name or not name.strip():
|
||||
return "Error: 'name' must not be empty."
|
||||
|
||||
params: dict[str, Any] = {
|
||||
"name": name,
|
||||
"date": date,
|
||||
"type": meal_type,
|
||||
}
|
||||
|
||||
try:
|
||||
data = _authenticated_call("mpcreate", 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
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user