get_gameweek_status
Retrieve precise status and timing details for the current, previous, and next gameweeks to manage your Fantasy Premier League team.
Instructions
Get precise information about current, previous, and next gameweeks
Returns:
Detailed information about gameweek timing, including exact statusInput Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/fpl_mcp/__main__.py:197-239 (handler)The actual handler function for the 'get_gameweek_status' tool. It fetches gameweeks via the API, determines current, previous, and next gameweeks, computes the precise status (Upcoming, Imminent, In Progress, Complete), and returns a formatted response with gameweek IDs, season progress, and exact timing.
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"] } } - src/fpl_mcp/__main__.py:196-197 (registration)The tool is registered using the @mcp.tool() decorator on the get_gameweek_status function at line 196 in src/fpl_mcp/__main__.py. No schema files are used; the input validation is implicit via the decorator.
@mcp.tool() async def get_gameweek_status() -> Dict[str, Any]: