get_player_awards
Retrieve awards for an NBA player by specifying their unique Player ID. This tool integrates with the NBA MCP server to fetch player-specific accolades directly.
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)This is the handler function for the 'get_player_awards' tool, decorated with @mcp.tool for registration. It fetches player awards using the nba_api.stats.endpoints.playerawards.PlayerAwards endpoint and returns the data as a dict, with error handling.@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)}