Skip to main content
Glama
stevenyuser

NBA MCP Server

by stevenyuser

get_team_details

Retrieve comprehensive NBA team information including championships, awards, background, and history by providing a team ID.

Instructions

Get details for a team by their ID. Details include championship awards, conference awards, division awards, background, history, and more.

Args: team_id: str The id of the team.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
team_idYes

Implementation Reference

  • server.py:66-80 (handler)
    The main handler function for the 'get_team_details' tool. It is decorated with @mcp.tool, which registers it as an MCP tool. The function fetches team details using the nba_api library, handling errors gracefully.
    @mcp.tool
    def get_team_details(team_id: str) -> dict:
        """
        Get details for a team by their ID.
        Details include championship awards, conference awards, division awards, background, history, and more.
    
        Args:
          team_id: str
            The id of the team.
        """
        try:
            details = teamdetails.TeamDetails(team_id=team_id)
            return details.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