get_nightly_forecast
Generate a personalized stargazing forecast with visible planets and deep-sky objects for your location and date.
Instructions
Get a curated list of best objects to view for the night.
Args: lon: Observer longitude in degrees lat: Observer latitude in degrees time: Date string "YYYY-MM-DD HH:MM:SS" (Time of observation, or just date) time_zone: IANA timezone string limit: Max number of deep-sky objects to return (default 20)
Returns: Dict with keys: - moon_phase: Moon details - planets: List of visible planets - deep_sky: Sorted list of deep sky objects (Messier/NGC)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lon | Yes | ||
| lat | Yes | ||
| time | Yes | ||
| time_zone | Yes | ||
| limit | No |
Implementation Reference
- src/functions/celestial/impl.py:147-175 (handler)The main handler function for the 'get_nightly_forecast' tool. It is decorated with @mcp.tool(), processes input parameters, calls the core computation in a thread, and formats the response.@mcp.tool() async def get_nightly_forecast( lon: float, lat: float, time: str, time_zone: str, limit: int = 20 ) -> Dict[str, Any]: """Get a curated list of best objects to view for the night. Args: lon: Observer longitude in degrees lat: Observer latitude in degrees time: Date string "YYYY-MM-DD HH:MM:SS" (Time of observation, or just date) time_zone: IANA timezone string limit: Max number of deep-sky objects to return (default 20) Returns: Dict with keys: - moon_phase: Moon details - planets: List of visible planets - deep_sky: Sorted list of deep sky objects (Messier/NGC) """ location, time_info = process_location_and_time(lon, lat, time, time_zone) # Run in thread result = await asyncio.to_thread(calculate_nightly_forecast, location, time_info, limit) return format_response(result)