get_league_team_standings
Retrieve NBA team standings for specific seasons and season types to track team performance and rankings.
Instructions
Get league team standings for a given season and season type.
Args: season: str The season in the format 'YYYY-YY'. season_type: str The type of season. Pattern: "Regular Season", "Pre Season"
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| season | Yes | ||
| season_type | Yes |
Implementation Reference
- server.py:119-135 (handler)The handler function that implements the 'get_league_team_standings' tool logic. It uses the nba_api library to fetch league standings for a specified season and season type, handling errors gracefully.def get_league_team_standings(season: str, season_type: str) -> dict: """ Get league team standings for a given season and season type. Args: season: str The season in the format 'YYYY-YY'. season_type: str The type of season. Pattern: "Regular Season", "Pre Season" """ try: standings = leaguestandingsv3.LeagueStandingsV3(league_id="00", season=season, season_type=season_type) return standings.get_dict() except Exception as e: return {"error": str(e)}
- server.py:118-118 (registration)The @mcp.tool decorator registers the get_league_team_standings function as an MCP tool.@mcp.tool