Skip to main content
Glama
iijimam

RAGandLLM-MCP

by iijimam

get_recipe

Generate recipes using user preferences and identified fish data to create customized cooking instructions.

Instructions

ユーザプロンプトと前回取得した魚名、魚IDを元にレシピ生成

Input Schema

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

Implementation Reference

  • Core handler function implementing the 'get_recipe' tool logic: constructs a JSON payload with user input, fish ID, and name, then POSTs to the /recipe2 API endpoint and returns the response.
    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
  • JSON Schema defining the input parameters for the 'get_recipe' tool: UserInput, FishID, and FishName as required strings.
    inputSchema={
        "type": "object",
        "properties": {
            "UserInput": {
                "type": "string",
                "description": "ユーザのレシピに対する希望。例:夏バテ防止レシピ"
            },
            "FishID": {
                "type": "string",
                "description": "魚の画像アップロード後に得られた魚ID"
            },
            "FishName": {
                "type": "string",
                "description": "魚の画像アップロード後に得られた魚の名称"
            }
        },
        "required": ["UserInput","FishID","FishName"]
    }
  • Registration of the 'get_recipe' tool in the list_tools() handler, including name, description, and input schema.
    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"]
        }
    ),
  • Dispatch handler in @server.call_tool() for 'get_recipe': extracts arguments, calls the get_recipe function, formats response 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)}"
                )
            ]
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool generates recipes but doesn't describe what that entails (e.g., format, length, whether it's AI-generated, if it includes cooking steps). It lacks information on permissions, rate limits, or error handling, leaving significant gaps for a tool that likely performs a complex operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Japanese that directly states the tool's function and inputs. It's front-loaded with the core purpose and avoids unnecessary words, though it could be slightly more structured (e.g., separating purpose from input explanation).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a recipe generation tool with 3 required parameters and no annotations or output schema, the description is incomplete. It doesn't explain what the output looks like (e.g., text recipe, structured data), how recipes are generated, or any behavioral aspects like response format or limitations. The schema covers inputs well, but the overall context for using the tool is insufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds minimal value beyond the schema by mentioning the parameters in context ('ユーザプロンプトと前回取得した魚名、魚IDを元に'), but doesn't provide additional syntax, format details, or usage examples that aren't already in the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'レシピ生成' (recipe generation) based on user prompts and previously obtained fish information. It specifies the inputs (user prompt, fish name, fish ID) but doesn't distinguish itself from sibling tools like 'register_choka' or 'upload_file', which appear unrelated to recipe generation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing fish identification first), exclusions, or how it relates to sibling tools. Usage is implied through the input parameters but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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