get_gameweek_status
Check current, previous, and next gameweek statuses in Fantasy Premier League to track match timing and plan team selections.
Instructions
Get precise information about current, previous, and next gameweeks
Returns:
Detailed information about gameweek timing, including exact status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/fpl_mcp/__main__.py:196-240 (handler)The main handler function for the 'get_gameweek_status' MCP tool. It fetches all gameweeks from the FPL API, identifies current/previous/next gameweeks, determines the precise status of the current gameweek (Not Started, Upcoming, Imminent, In Progress, Complete), and returns structured data including deadlines and season progress.@mcp.tool() async def get_gameweek_status() -> Dict[str, Any]: """Get precise information about current, previous, and next gameweeks Returns: Detailed information about gameweek timing, including exact status """ gameweeks = await api.get_gameweeks() # Find current, previous, and next gameweeks current_gw = next((gw for gw in gameweeks if gw.get("is_current")), None) previous_gw = next((gw for gw in gameweeks if gw.get("is_previous")), None) next_gw = next((gw for gw in gameweeks if gw.get("is_next")), None) # Determine exact current gameweek status current_status = "Not Started" if current_gw: deadline = datetime.datetime.strptime(current_gw["deadline_time"], "%Y-%m-%dT%H:%M:%SZ") now = datetime.datetime.utcnow() if now < deadline: current_status = "Upcoming" time_until = deadline - now hours_until = time_until.total_seconds() / 3600 if hours_until < 24: current_status = "Imminent (< 24h)" else: if current_gw.get("finished"): current_status = "Complete" else: current_status = "In Progress" return { "current_gameweek": current_gw and current_gw["id"], "current_status": current_status, "previous_gameweek": previous_gw and previous_gw["id"], "next_gameweek": next_gw and next_gw["id"], "season_progress": f"GW {current_gw and current_gw['id']}/38" if current_gw else "Unknown", "exact_timing": { "current_deadline": current_gw and current_gw["deadline_time"], "next_deadline": next_gw and next_gw["deadline_time"] } }