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"
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"season": "<season>",
"season_type": "<season_type>"
},
"name": "get_league_team_standings"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| season | Yes | ||
| season_type | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
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