get_mlb_game_highlights
Retrieve MLB game highlights using a specific game ID with this tool. Access key moments and video snippets from any MLB game through the mlb-api-mcp server. Ideal for integrating baseball highlights into applications or analysis.
Instructions
Get game highlights for a specific game by game_id.
Args: game_id (int): The game ID.
Returns: dict: Game highlights.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| game_id | Yes |
Implementation Reference
- mlb_api.py:450-466 (handler)The handler function implementing the logic for the 'get_mlb_game_highlights' tool. It fetches highlights using mlb.get_game(game_id).content.highlights.@mcp.tool() def get_mlb_game_highlights(game_id: int) -> dict: """ Get game highlights for a specific game by game_id. Args: game_id (int): The game ID. Returns: dict: Game highlights. """ try: highlights = mlb.get_game(game_id).content.highlights return highlights except Exception as e: return {"error": str(e)}
- main.py:21-23 (registration)Registers the MLB tools, including 'get_mlb_game_highlights', by calling setup_mlb_tools(mcp). The actual @mcp.tool() decorators are within setup_mlb_tools in mlb_api.py.# Setup all MLB and generic tools setup_mlb_tools(mcp) setup_generic_tools(mcp)