Skip to main content
Glama
stevenyuser

NBA MCP Server

by stevenyuser

get_team_year_by_year_stats

Retrieve detailed year-by-year statistics for any NBA team using their unique ID. Access historical performance data to analyze trends and team progress over seasons.

Instructions

Get year-by-year stats for a team by their ID.

Args: team_id: str The id of the team.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
team_idYes

Implementation Reference

  • server.py:82-96 (handler)
    This is the handler function for the 'get_team_year_by_year_stats' tool. It uses the nba_api to fetch year-by-year stats for a given team ID and returns the data as a dictionary, with error handling.
    @mcp.tool def get_team_year_by_year_stats(team_id: str) -> dict: """ Get year-by-year stats for a team by their ID. Args: team_id: str The id of the team. """ try: stats = teamyearbyyearstats.TeamYearByYearStats(team_id=team_id) return stats.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