Skip to main content
Glama
iijimam
by iijimam

get_recipe

Generate personalized recipes based on user input, fish name, and fish info. Perfect for creating customized meal plans using specific ingredients and preferences.

Instructions

ユーザプロンプトと前回取得した情報を元にレシピ生成

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
FishInfoYes魚の画像ファイルアップロード後に得られた魚情報
FishNameYes魚の画像ファイルから得られた魚の名称
UserInputYesユーザのレシピに対する希望。例:夏バテ防止レシピ

Implementation Reference

  • Core handler function that implements the get_recipe tool logic by making a POST request to the /recipe2 API endpoint with user input, fish ID, and fish name.
    async def get_recipe(user_input: str, fish_id:str, fish_name: str) -> str: headers={ "Content-Type":"application/json;charset=utf-8" } # 送信するJSONボディを組み立て body = { "UserInput": user_input, "FishID": fish_id, "FishName": fish_name } async with httpx.AsyncClient(timeout=80.0,verify=False) as client: response = await client.post( f"{API_BASE_URL}/recipe2", headers=headers, json=body ) response.raise_for_status() data = response.json() return data
  • Registers the get_recipe tool with the MCP server via list_tools(), including name, description, and input schema definition.
    types.Tool( name="get_recipe", description="ユーザプロンプトと前回取得した魚名、魚IDを元にレシピ生成", inputSchema={ "type": "object", "properties": { "UserInput": { "type": "string", "description": "ユーザのレシピに対する希望。例:夏バテ防止レシピ" }, "FishID": { "type": "string", "description": "魚の画像アップロード後に得られた魚ID" }, "FishName": { "type": "string", "description": "魚の画像アップロード後に得られた魚の名称" } }, "required": ["UserInput","FishID","FishName"] } ),
  • MCP tool call handler that parses arguments, invokes the get_recipe function, and returns the result or error as TextContent.
    elif name == "get_recipe": if not isinstance(arguments, dict): raise ValueError("Invalid forecast arguments") userinput=arguments["UserInput"] fish_id=arguments["FishID"] fish_name=arguments["FishName"] try: answer= await get_recipe(userinput,fish_id,fish_name) return [ types.TextContent( type="text", text=json.dumps(answer,ensure_ascii=False, indent=2) #text=f"🎉 IRIS接続成功!\n📥 応答::{msg}" ) ] except Exception as e: error_details = { "error_type": type(e).__name__, "error_message": str(e), } return [ types.TextContent( type="text", text=f"エラーが発生しました(recipe): {json.dumps(error_details, ensure_ascii=False, indent=2)}" ) ] except httpx.HTTPError as e: logger.error(f"IRIS API error: {str(e)}") return [ types.TextContent( type="text", text=f"エラーが発生しました(recipe): {str(e)}" ) ]
  • JSON schema defining the input parameters for the get_recipe tool: UserInput (string), FishID (string), FishName (string).
    inputSchema={ "type": "object", "properties": { "UserInput": { "type": "string", "description": "ユーザのレシピに対する希望。例:夏バテ防止レシピ" }, "FishID": { "type": "string", "description": "魚の画像アップロード後に得られた魚ID" }, "FishName": { "type": "string", "description": "魚の画像アップロード後に得られた魚の名称" } }, "required": ["UserInput","FishID","FishName"] }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/iijimam/RAGandLLM-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server