Add cook later
This commit is contained in:
@@ -531,6 +531,19 @@ def create_server() -> MCPServer:
|
||||
async def recipe_get(recipe_id: str) -> dict[str, Any]:
|
||||
return await api_request('GET', f'recipes/{recipe_id}/')
|
||||
|
||||
@server.tool(structured_output=True, description='Save one owned recipe to your Cook Later list. Idempotent; does not log a meal or use inventory.')
|
||||
async def recipe_cook_later_add(recipe_id: str) -> dict[str, Any]:
|
||||
return await api_request('POST', 'recipes/cook-later/', payload={'recipe_id': recipe_id})
|
||||
|
||||
@server.tool(structured_output=True, description='Remove one owned recipe from your Cook Later list. Repeated removal is safe.')
|
||||
async def recipe_cook_later_remove(recipe_id: str) -> dict[str, Any]:
|
||||
return await api_request('DELETE', f'recipes/cook-later/{recipe_id}/')
|
||||
|
||||
@server.tool(structured_output=True, description='List your Cook Later recipes with stable recipe IDs, titles, summaries and save dates. Read only.')
|
||||
async def recipe_cook_later_list(search: str = '', limit: int = 20, offset: int = 0) -> dict[str, Any]:
|
||||
return await api_request('GET', 'recipes/cook-later/',
|
||||
params={'search': search, 'limit': limit, 'offset': offset})
|
||||
|
||||
@server.tool(structured_output=True, description='Create an owned recipe. Add measured ingredients with recipe_ingredient_add. Reuse idempotency_key on retries.')
|
||||
async def recipe_create(recipe: RecipeInput, idempotency_key: str | None = None) -> dict[str, Any]:
|
||||
key = _key(idempotency_key)
|
||||
|
||||
Reference in New Issue
Block a user