# Optimized Prompt (Clavix Enhanced)
Enhance the Mealie MCP server (`src/tools/recipe.ts`) with four capabilities:
## 1. Recipe Notes (Inline with create/update)
Add `notes` parameter to `create_recipe` and `update_recipe` tools. Each note is `{title: string, text: string}`. Update the Recipe type if needed. Pass notes array to the Mealie API on recipe create/update.
## 2. Recipe Images (New Tool)
Create `add_recipe_image` tool that:
- Accepts `slug` (recipe identifier) and either `image_url` OR `image_base64`
- If URL provided: MCP fetches image locally (bypasses IP blocks), converts to base64
- Uploads to Mealie via `PUT /api/recipes/{slug}/image` (multipart/form-data)
- Returns success/failure with recipe slug
## 3. Recipe Servings (Inline with create/update)
Add to `create_recipe` and `update_recipe`:
- `servings` (number) → maps to `recipeServings`
- `yield_text` (string, optional) → maps to `recipeYield` (e.g., "Makes 12 cookies")
## 4. Structured Ingredients Guidance
Update tool descriptions for `create_recipe` and `update_recipe` to:
- Emphasize structured ingredients `{quantity, unit, food, note}` as the **preferred** format
- Explain that structured format enables proper unit/food tracking in Mealie
- Note that plain text strings are a fallback, not the default
## Files to Modify
- `src/tools/recipe.ts` - Add notes, servings params; update descriptions
- `src/types/recipe.ts` - Add RecipeNote type if missing
- `src/client.ts` - May need image upload method
## Success Criteria
- `create_recipe` and `update_recipe` accept notes array and servings fields
- New `add_recipe_image` tool fetches URLs locally and uploads to Mealie
- Tool descriptions clearly guide AI toward structured ingredients
- All existing functionality remains unchanged
---
## Optimization Improvements Applied
1. **[STRUCTURED]** - Organized into 4 numbered sections with clear headers
2. **[ACTIONABILITY]** - Added specific file paths to modify
3. **[COMPLETENESS]** - Added API endpoint details (`PUT /api/recipes/{slug}/image`)
4. **[CLARITY]** - Specified exact parameter names and types
5. **[SCOPED]** - Defined what "structured ingredients guidance" means concretely
---
*Optimized by Clavix on 2025-12-12. This version is ready for implementation.*