get_player_game_log
Retrieve detailed game logs for NBA players by specifying their ID, season, and season type to analyze performance across Regular Season, Playoffs, Pre Season, or All Star games.
Instructions
Get game log for a player by their ID, season, and season type.
Args: player_id: str The id of the player. season: str The season in the format 'YYYY-YY'. season_type: str The type of season. Pattern: "Regular Season", "Pre Season", "Playoffs", "All Star"
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| player_id | Yes | ||
| season | Yes | ||
| season_type | Yes |
Implementation Reference
- server.py:42-62 (handler)The handler function for the 'get_player_game_log' tool. It is decorated with @mcp.tool for registration and uses the nba_api to fetch player game log data for a given player ID, season, and season type.@mcp.tool def get_player_game_log(player_id: str, season: str, season_type: str) -> dict: """ Get game log for a player by their ID, season, and season type. Args: player_id: str The id of the player. season: str The season in the format 'YYYY-YY'. season_type: str The type of season. Pattern: "Regular Season", "Pre Season", "Playoffs", "All Star" """ try: log = playergamelog.PlayerGameLog(player_id=player_id, season=season, season_type_all_star=season_type) return log.get_dict() except Exception as e: return {"error": str(e)}