get_mlb_linescore
Retrieve detailed inning-by-inning scoring data for MLB games using game IDs to analyze game progress and outcomes.
Instructions
Get linescore for a specific game by game_id.
Args: game_id (int): The game ID.
Returns: dict: Linescore information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| game_id | Yes |
Implementation Reference
- mlb_api.py:518-533 (handler)The core handler function for the 'get_mlb_linescore' tool, decorated with @mcp.tool() which registers it as an MCP tool. It retrieves the linescore data for a given MLB game ID using the MLB API.@mcp.tool() def get_mlb_linescore(game_id: int) -> dict: """ Get linescore for a specific game by game_id. Args: game_id (int): The game ID. Returns: dict: Linescore information. """ try: linescore = mlb.get_game_line_score(game_id) return linescore except Exception as e: return {"error": str(e)}