get_team_game_log
Retrieve detailed game logs for NBA teams by specifying team ID, season, and season type to analyze performance across regular season, playoffs, or other periods.
Instructions
Get game log for a team by their ID, season, and season type.
Args: team_id: str The id of the team. 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 |
|---|---|---|---|
| team_id | Yes | ||
| season | Yes | ||
| season_type | Yes |
Implementation Reference
- server.py:97-116 (handler)The handler function decorated with @mcp.tool, implementing the get_team_game_log tool. It uses the nba_api to fetch team game log data for a given team ID, season, and season type, returning the data as a dictionary or an error message.@mcp.tool def get_team_game_log(team_id: str, season: str, season_type: str) -> dict: """ Get game log for a team by their ID, season, and season type. Args: team_id: str The id of the team. 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 = teamgamelog.TeamGameLog(team_id=team_id, season=season, season_type_all_star=season_type) return log.get_dict() except Exception as e: return {"error": str(e)}