Skip to main content
Glama
stevenyuser

NBA MCP Server

by stevenyuser

get_player_game_log

Retrieve detailed game-by-game statistics for NBA players by specifying player ID, season, and season type to analyze performance trends.

Instructions

Get game log for a player by their ID, season, and season type.

Args: player_id: str The id of the player. season: str The season in the format 'YYYY-YY'. season_type: str The type of season. Pattern: "Regular Season", "Pre Season", "Playoffs", "All Star"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
player_idYes
seasonYes
season_typeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.py:42-62 (handler)
    The @mcp.tool decorated handler function implementing the get_player_game_log tool. It retrieves the game log for a specified player, season, and season type using the nba_api library, with error handling.
    @mcp.tool
    def get_player_game_log(player_id: str, season: str, season_type: str) -> dict:
       """
       Get game log for a player by their ID, season, and season type.
    
       Args:
          player_id: str
            The id of the player.
          season: str
            The season in the format 'YYYY-YY'.
          season_type: str
            The type of season. Pattern: "Regular Season", "Pre Season", "Playoffs", "All Star"
        """
    
       try:
          log = playergamelog.PlayerGameLog(player_id=player_id, 
                                            season=season, 
                                            season_type_all_star=season_type)
          return log.get_dict()
       except Exception as e:
          return {"error": str(e)}
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool retrieves data ('Get game log'), implying it's a read operation, but doesn't disclose behavioral traits like rate limits, authentication needs, error handling, or what format the game log returns. The description is minimal and lacks crucial operational context for a tool with no annotations.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded, with the purpose stated first followed by parameter details. It uses bullet points for clarity and avoids redundancy. However, the parameter explanations could be more integrated into the main text, and some sentences are brief but necessary, earning a 4 for efficiency with minor structural improvements possible.

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

Completeness3/5

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

Given 3 parameters with 0% schema coverage and no annotations, but with an output schema present, the description is partially complete. It explains the parameters but lacks behavioral context and usage guidelines. The output schema handles return values, so the description doesn't need to explain those, but it should cover more operational aspects for a tool with no annotations, making it adequate but with clear gaps.

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

Parameters3/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 player_id as 'the id of the player', season format as 'YYYY-YY', and season_type with a pattern list. However, it doesn't fully cover all parameters' semantics (e.g., where to find player_id, valid season ranges, or default behaviors), leaving gaps. Baseline is 3 as it adds some value but incompletely.

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

Purpose4/5

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

The description clearly states the action ('Get game log') and resource ('for a player'), specifying it retrieves statistical records. It distinguishes from siblings like get_player_career_stats (career vs. specific season) and get_team_game_log (player vs. team), though not explicitly. However, it lacks explicit sibling differentiation, keeping it at 4 instead of 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose get_player_game_log over get_player_career_stats or get_team_game_log, nor does it specify prerequisites like needing a valid player ID. Usage is implied through parameter descriptions but not explicitly stated.

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