Skip to main content
Glama
stevenyuser

NBA MCP Server

by stevenyuser

get_live_game_boxscore

Retrieve live NBA game statistics including scores, player performance data, and game events using a specific game identifier.

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function decorated with @mcp.tool, which defines and registers the get_live_game_boxscore tool. It fetches live boxscore data using nba_api.
    @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 tool with the MCP server.
    @mcp.tool
  • Docstring defining the tool's input schema (game_id: str) and description.
    """
    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.
    """
  • server.py:4-4 (helper)
    Import of boxscore endpoint used in the handler.
    from nba_api.live.nba.endpoints import scoreboard, boxscore, playbyplay
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses that the tool retrieves live data, implying real-time or current game status, which is useful behavioral context. However, it lacks details on permissions, rate limits, error handling, or whether data is cached/static, leaving gaps for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by additional context in the second, and includes a structured 'Args' section for parameters. Every sentence adds value without redundancy, making it efficient and well-organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values), no annotations, and low schema coverage, the description is reasonably complete. It covers purpose, parameter semantics, and data inclusions, but could improve by addressing behavioral aspects like error cases or data freshness, given the lack of annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining that 'game_id' refers to 'The ID of the game,' clarifying the parameter's purpose beyond the schema's basic type. However, it does not specify the ID format (e.g., numeric, string pattern) or provide examples, which could enhance usability.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get the box score') and resource ('for a specific game by its ID'), distinguishing it from siblings like get_live_game_play_by_play (which provides play-by-play data) and get_today_scoreboard (which lists multiple games). It explicitly mentions what the box score includes (live data, scores, player stats, timeouts).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying 'for a specific game by its ID' and listing included data types, which helps differentiate from siblings like get_team_game_log or get_player_career_stats. However, it does not explicitly state when not to use this tool or name alternatives (e.g., vs. get_live_game_play_by_play for different data).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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