Skip to main content
Glama
stevenyuser

NBA MCP Server

by stevenyuser

get_player_career_stats

Retrieve NBA player career statistics by inputting their unique player ID using the NBA MCP Server for accurate and detailed data analysis.

Instructions

Get career stats for a player by their ID.

Args: player_id: str The id of the player.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
player_idYes

Implementation Reference

  • server.py:13-25 (handler)
    The main handler function for the 'get_player_career_stats' tool. It takes a player_id, fetches career stats using nba_api.stats.endpoints.playercareerstats.PlayerCareerStats, and returns the data as a dict or an error message.
    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)}
  • server.py:12-12 (registration)
    The @mcp.tool decorator registers the get_player_career_stats function as an MCP tool.
    @mcp.tool
  • The docstring provides the schema description, including the player_id argument of type str.
    """ Get career stats for a player by their ID. Args: player_id: str The id of the player. """

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/stevenyuser/nba_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server