get_mlb_game_pace
Retrieve game pace statistics for a specific MLB season using season year and sport ID. Access key metrics to analyze gameplay duration and trends in baseball data.
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 handler function implementing the 'get_mlb_game_pace' tool logic. It is decorated with @mcp.tool(), which also handles registration in the MCP server. Calls mlb.get_gamepace to fetch game pace stats for the season.@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)}
- main.py:22-23 (registration)Call to setup_mlb_tools which defines and registers all MLB tools, including 'get_mlb_game_pace', on the MCP server instance.setup_mlb_tools(mcp) setup_generic_tools(mcp)