check_fpl_authentication
Verify FPL authentication status and retrieve basic team information to ensure access to Fantasy Premier League data and related features.
Instructions
Check if FPL authentication is working correctly
Returns:
Authentication status and basic team information
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"title": "check_fpl_authenticationArguments",
"type": "object"
}
Implementation Reference
- src/fpl_mcp/__main__.py:149-194 (handler)The handler function for the 'check_fpl_authentication' MCP tool. It checks FPL authentication using the auth_manager singleton, tests by fetching entry data, and returns status with team details or error messages including setup instructions.@mcp.tool() async def check_fpl_authentication() -> Dict[str, Any]: """Check if FPL authentication is working correctly Returns: Authentication status and basic team information """ try: from .fpl.auth_manager import get_auth_manager auth_manager = get_auth_manager() team_id = auth_manager.team_id if not team_id: return { "authenticated": False, "error": "No team ID found in credentials", "setup_instructions": "Run 'fpl-mcp-config setup' to configure your FPL credentials" } # Try to get basic team info as authentication test try: entry_data = await auth_manager.get_entry_data() return { "authenticated": True, "team_name": entry_data.get("name"), "manager_name": f"{entry_data.get('player_first_name')} {entry_data.get('player_last_name')}", "overall_rank": entry_data.get("summary_overall_rank"), "team_id": team_id } except Exception as e: return { "authenticated": False, "error": f"Authentication failed: {str(e)}", "setup_instructions": "Check your FPL credentials and ensure they are correct" } except Exception as e: logger.error(f"Authentication check failed: {e}") return { "authenticated": False, "error": str(e), "setup_instructions": "Run 'fpl-mcp-config setup' to configure your FPL credentials" }