Skip to main content
Glama

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
NameRequiredDescriptionDefault
game_idYes

Implementation Reference

  • 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)

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/guillochon/mlb-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server