Skip to main content
Glama
rishijatia

Fantasy Premier League MCP Server

check_fpl_authentication

Verify Fantasy Premier League account authentication status and retrieve basic team information to ensure access to FPL data.

Instructions

Check if FPL authentication is working correctly

Returns:
    Authentication status and basic team information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the check_fpl_authentication tool. It checks FPL authentication by retrieving the auth manager singleton, verifying team ID, and attempting to fetch entry data from the FPL API.
    @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"
            }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rishijatia/fantasy-pl-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server