select_weather_forecast_city_israel
Select the first city from the Israeli weather forecast list and navigate to its detailed forecast page for current conditions.
Instructions
שלב 3: בוחר את העיר הראשונה מהרשימה ועובר לדף התחזית המפורט.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- weather_Israel.py:93-114 (handler)The tool 'select_weather_forecast_city_israel' is registered via @mcp.tool() decorator and implemented as an async function. It uses Playwright to click the first autocomplete suggestion on the weather forecast website, navigates to the detailed forecast page, and returns a success/error message.
@mcp.tool() async def select_weather_forecast_city_israel() -> str: """ שלב 3: בוחר את העיר הראשונה מהרשימה ועובר לדף התחזית המפורט. """ page = await browser_mgr.ensure_page() # סלקטור גמיש לרשימת ההשלמה item_selector = ".autocomplete-items div, .autocomplete-suggestion" try: await page.wait_for_selector(item_selector, timeout=7000) # לחיצה והמתנה לטעינת הדף החדש (networkidle מבטיח שהמידע נטען) async with page.expect_navigation(wait_until="networkidle", timeout=15000): await page.click(item_selector) return "SUCCESS: העיר נבחרה ודף התחזית נטען בהצלחה." except Exception: # גיבוי: לחיצה על Enter אם הרשימה לא נלחצה await page.keyboard.press("Enter") await asyncio.sleep(4) return "SUCCESS: בוצעה בחירה באמצעות Enter. בדוק אם הדף נטען." - weather_Israel.py:93-93 (registration)The tool is registered using the @mcp.tool() decorator on line 93, which binds it to the FastMCP server instance named 'mcp' created on line 6.
@mcp.tool()