human_weather_tool
Request human assistance to check and report current weather conditions at a specific location through interactive collaboration.
Instructions
人間が現在地の天気を確認して報告します。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- human_mcp/mcp_server.py:103-121 (handler)The core handler function decorated with @mcp.tool(). It creates a database task with a fixed instruction to check current weather, polls asynchronously for human-provided result using wait_for_task_completion, logs progress, and returns the weather information.@mcp.tool() async def human_weather_tool(ctx: Context) -> Dict[str, str]: """人間が現在地の天気を確認して報告します。""" task_id = str(uuid.uuid4()) instruction = f"🌤️ 現在地の天気を確認してください" # タスクをデータベースに追加 db_utils.add_task(task_id, instruction) # ログ出力 sys.stderr.write(f"Human task created: {task_id}. Waiting for completion...\n") # 結果を待機(非同期ポーリング) result = await wait_for_task_completion(task_id) # ログ出力 sys.stderr.write(f"Human task {task_id} completed.\n") return {"weather": result}
- human_mcp/tools.py:59-74 (schema)JSON schema definition for human_weather_tool, specifying no input parameters and output as a 'weather' string.{ "name": "human_weather_tool", "description": "人間が現在地の天気を確認して報告します。", "input_schema": { "type": "object", "properties": {}, "required": [] }, "output_schema": { "type": "object", "properties": { "weather": {"type": "string", "description": "現在地の天気情報"} }, "required": ["weather"] } }