get_team_year_by_year_stats
Retrieve detailed year-by-year statistics for any NBA team using their unique ID. Access historical performance data to analyze trends and team progress over seasons.
Instructions
Get year-by-year stats for a team by their ID.
Args: team_id: str The id of the team.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| team_id | Yes |
Implementation Reference
- server.py:82-96 (handler)This is the handler function for the 'get_team_year_by_year_stats' tool. It uses the nba_api to fetch year-by-year stats for a given team ID and returns the data as a dictionary, with error handling.@mcp.tool def get_team_year_by_year_stats(team_id: str) -> dict: """ Get year-by-year stats for a team by their ID. Args: team_id: str The id of the team. """ try: stats = teamyearbyyearstats.TeamYearByYearStats(team_id=team_id) return stats.get_dict() except Exception as e: return {"error": str(e)}