get_mlb_game_pace
Retrieve game pace statistics for MLB seasons to analyze game duration trends and timing patterns.
Instructions
Get game pace statistics for a given season.
Args: season (int): Season year. sport_id (int): Sport ID (default: 1 for MLB).
Returns: dict: Game pace statistics.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| season | Yes | ||
| sport_id | No |
Implementation Reference
- mlb_api.py:467-483 (handler)The core handler function for the 'get_mlb_game_pace' MCP tool. Decorated with @mcp.tool(), it defines the tool logic, input schema via type hints and docstring, and handles execution by calling mlb.get_gamepace with error handling.@mcp.tool() def get_mlb_game_pace(season: int, sport_id: int = 1) -> dict: """ Get game pace statistics for a given season. Args: season (int): Season year. sport_id (int): Sport ID (default: 1 for MLB). Returns: dict: Game pace statistics. """ try: gamepace = mlb.get_gamepace(str(season), sport_id=sport_id) return gamepace except Exception as e: return {"error": str(e)}