get_player_awards
Retrieve NBA player awards by providing their unique identifier. This tool accesses the NBA database to return recognition and honors for specific basketball players.
Instructions
Get awards 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:27-40 (handler)The main handler function for the 'get_player_awards' tool. It is decorated with @mcp.tool for registration. Takes a player_id, fetches awards using nba_api.stats.endpoints.playerawards.PlayerAwards, and returns the data as dict or error.@mcp.tool def get_player_awards(player_id: str) -> dict: """ Get awards for a player by their ID. Args: player_id: str The id of the player. """ try: awards = playerawards.PlayerAwards(player_id=player_id) return awards.get_dict() except Exception as e: return {"error": str(e)}