Skip to main content
Glama
stevenyuser

NBA MCP Server

by stevenyuser

get_team_game_log

Retrieve detailed game logs for an NBA team by specifying the team ID, season, and season type. Useful for analyzing team performance across different stages of the NBA season.

Instructions

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

Args: team_id: str The id of the team. 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
seasonYes
season_typeYes
team_idYes

Implementation Reference

  • The main handler function for the 'get_team_game_log' tool. It is decorated with @mcp.tool, which registers it as an MCP tool. The function retrieves the team game log using the nba_api library, handling the specified team ID, season, and season type, and returns the data as a dictionary or an error message.
    @mcp.tool def get_team_game_log(team_id: str, season: str, season_type: str) -> dict: """ Get game log for a team by their ID, season, and season type. Args: team_id: str The id of the team. 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 = teamgamelog.TeamGameLog(team_id=team_id, season=season, season_type_all_star=season_type) return log.get_dict() except Exception as e: return {"error": str(e)}

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