register_choka
Register fishing catch records by specifying fish details including ID, name, size, and count for tracking and analysis.
Instructions
釣果登録が行えます
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| FishID | Yes | upload_fileの応答JSONにあるFishIDを使用する。upload_fileを事前に実行していいない場合はユーザによる指定が必要 | |
| FishName | Yes | upload_fileの応答JSONにあるFishNameを使用する。upload_fileを事前に実行していいない場合はユーザによる指定が必要 | |
| FishSize | Yes | 釣果登録時、魚の体長をセンチメートルで指定する | |
| FishCount | Yes | 釣果登録時、釣った魚の数を指定する。 |
Implementation Reference
- src/ragandllm_mcp/server.py:36-56 (handler)The main handler function for the 'register_choka' tool. It constructs a JSON payload with fish_id, fish_name, fish_size, and fish_count, sends a POST request to the '/choka' API endpoint, and returns the JSON response.async def register_choka(fish_id: str, fish_name: str, fish_size: str,fish_count:int) -> str: headers={ "Content-Type":"application/json;charset=utf-8" } # 送信するJSONボディを組み立て body = { "FishID": fish_id, "FishName": fish_name, "Size": fish_size, "FishCount": fish_count, } async with httpx.AsyncClient(timeout=80.0,verify=False) as client: response = await client.post( f"{API_BASE_URL}/choka", headers=headers, json=body ) response.raise_for_status() data = response.json() return data
- src/ragandllm_mcp/server.py:121-146 (registration)Registers the 'register_choka' tool in the MCP server's list_tools() handler, including name, description, and input schema.types.Tool( name="register_choka", description="釣果登録が行えます", inputSchema={ "type": "object", "properties": { "FishID": { "type": "string", "description": "upload_fileの応答JSONにあるFishIDを使用する。upload_fileを事前に実行していいない場合はユーザによる指定が必要" }, "FishName": { "type": "string", "description": "upload_fileの応答JSONにあるFishNameを使用する。upload_fileを事前に実行していいない場合はユーザによる指定が必要" }, "FishSize": { "type": "string", "description": "釣果登録時、魚の体長をセンチメートルで指定する" }, "FishCount": { "type": "integer", "description": "釣果登録時、釣った魚の数を指定する。" } }, "required": ["FishID","FishName","FishSize","FishCount"] } )
- src/ragandllm_mcp/server.py:124-145 (schema)Input JSON schema for the 'register_choka' tool, defining required string fields for FishID, FishName, FishSize and integer FishCount.inputSchema={ "type": "object", "properties": { "FishID": { "type": "string", "description": "upload_fileの応答JSONにあるFishIDを使用する。upload_fileを事前に実行していいない場合はユーザによる指定が必要" }, "FishName": { "type": "string", "description": "upload_fileの応答JSONにあるFishNameを使用する。upload_fileを事前に実行していいない場合はユーザによる指定が必要" }, "FishSize": { "type": "string", "description": "釣果登録時、魚の体長をセンチメートルで指定する" }, "FishCount": { "type": "integer", "description": "釣果登録時、釣った魚の数を指定する。" } }, "required": ["FishID","FishName","FishSize","FishCount"] }
- src/ragandllm_mcp/server.py:233-251 (handler)Dispatch handler in the main @server.call_tool() function that extracts arguments, calls the register_choka function, and returns the result as TextContent.elif name == "register_choka": if not isinstance(arguments, dict): raise ValueError("Invalid forecast arguments") fish_id=arguments["FishID"] fish_name=arguments["FishName"] fish_size=arguments["FishSize"] fish_count=arguments["FishCount"] try: answer= await register_choka(fish_id,fish_name,fish_size,fish_count) return [ types.TextContent( type="text", text=json.dumps(answer,ensure_ascii=False, indent=2) #text=f"🎉 IRIS接続成功!\n📥 応答::{msg}" ) ]