Skip to main content
Glama
upamune
by upamune

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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}
  • 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"]
        }
    }

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/upamune/human-mcp'

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