get_player_career_stats
Retrieve comprehensive career statistics for NBA players by entering their unique player ID to access detailed performance data.
Instructions
Get career stats for a player by their ID.
Args: player_id: str The id of the player.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| player_id | Yes |
Implementation Reference
- server.py:12-25 (handler)The handler function for the 'get_player_career_stats' tool. It is decorated with @mcp.tool, which registers it as an MCP tool. The function retrieves NBA player career statistics using the nba_api library based on the provided player_id.@mcp.tool def get_player_career_stats(player_id: str) -> dict: """ Get career stats for a player by their ID. Args: player_id: str The id of the player. """ try: stats = playercareerstats.PlayerCareerStats(player_id=player_id) return stats.get_dict() except Exception as e: return {"error": str(e)}