Skip to main content
Glama

get_mlb_game_highlights

Retrieve MLB game highlights by providing a game ID to access key moments and plays from specific baseball games.

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 decorated with @mcp.tool(), which implements the tool logic by fetching highlights from the MLB API 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:22-22 (registration)
    The call to setup_mlb_tools(mcp) in the main server file, which defines and registers all MLB tools including get_mlb_game_highlights via decorators.
    setup_mlb_tools(mcp)
  • mlb_api.py:221-225 (registration)
    The setup_mlb_tools function where all MLB tools, including get_mlb_game_highlights, are defined and registered using @mcp.tool() decorators.
    def setup_mlb_tools(mcp): """Setup MLB tools for the MCP server""" @mcp.tool() def get_mlb_standings(

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