enter_weather_forecast_city_israel
Enter a city name to retrieve the weather forecast for that location in Israel.
Instructions
שלב 2: מזין את שם העיר בשדה החיפוש.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| city_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- weather_Israel.py:66-91 (handler)The main handler function for the 'enter_weather_forecast_city_israel' tool. It accepts a city_name, navigates to the forecast page if needed, locates the city search input (#city_search_forecast), clears it, types the city name with a delay to trigger autocomplete, and returns a success/error message.
async def enter_weather_forecast_city_israel(city_name: str) -> str: """ שלב 2: מזין את שם העיר בשדה החיפוש. """ page = await browser_mgr.ensure_page() search_selector = "#city_search_forecast" try: # ודוא שאנו בדף הנכון if "forecast" not in page.url: await page.goto(FORECAST_URL) await page.wait_for_selector(search_selector, timeout=10000) # ניקוי יסודי של השדה await page.click(search_selector, click_count=3) await page.keyboard.press("Control+A") await page.keyboard.press("Backspace") # הקלדה עם השהיה כדי להקפיץ את ה-Autocomplete await page.type(search_selector, city_name, delay=150) await asyncio.sleep(2) # זמן לרשימה להיפתח return f"SUCCESS: העיר '{city_name}' הוזנה. כעת בצע בחירה מהרשימה." except Exception as e: return f"ERROR: הזנת העיר נכשלה: {str(e)}" - weather_Israel.py:65-65 (registration)Registration decorator @mcp.tool() on line 65 registers enter_weather_forecast_city_israel as an MCP tool.
@mcp.tool() - weather_Israel.py:66-66 (schema)Type signature: city_name is a required str parameter, return type is str.
async def enter_weather_forecast_city_israel(city_name: str) -> str: