Skip to main content
Glama
stevenyuser

NBA MCP Server

by stevenyuser

get_live_game_boxscore

Retrieve live game box scores, including player stats, scores, and timeouts, by specifying the game ID using the NBA MCP Server. Access detailed NBA game data efficiently.

Instructions

Get the box score for a specific game by its ID. The box score includes live data for the game, such as scores, player stats, timeouts, and more.

Args: game_id: str The ID of the game.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
game_idYes

Implementation Reference

  • The main handler function for the 'get_live_game_boxscore' tool, decorated with @mcp.tool which registers it in the FastMCP server. It retrieves the live boxscore for a given game ID using the nba_api library.
    @mcp.tool def get_live_game_boxscore(game_id: str) -> dict: """ Get the box score for a specific game by its ID. The box score includes live data for the game, such as scores, player stats, timeouts, and more. Args: game_id: str The ID of the game. """ try: box = boxscore.BoxScore(game_id) if not box.game or not box.game.get_dict(): raise ValueError(f"No box score found for game ID: {game_id}") return box.game.get_dict() except Exception as e: return {"error": str(e)}
  • server.py:154-154 (registration)
    The @mcp.tool decorator registers the get_live_game_boxscore function as an MCP tool.
    @mcp.tool
  • The docstring defines the tool schema, including input parameter 'game_id: str'.
    """ Get the box score for a specific game by its ID. The box score includes live data for the game, such as scores, player stats, timeouts, and more. Args: game_id: str The ID of the game. """

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