Skip to main content
Glama
alex-rimerman

Statcast MCP Server

sprint_speed_leaderboard

Retrieve MLB player sprint speed rankings from Statcast data to analyze baserunning performance and identify top speed athletes by season.

Instructions

Get the Statcast sprint speed leaderboard.

Returns each player's sprint speed in feet per second, measured on competitive running plays. Sprint speed is one of the best measures of raw speed and baserunning ability.

Args: year: Season year (e.g. 2024). min_opportunities: Minimum competitive run opportunities (default 10). player_name: Optional. Filter to one player (e.g. 'Ronald Acuna Jr.').

Great for finding the fastest players in baseball.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYes
min_opportunitiesNo
player_nameNo

Implementation Reference

  • The handler function 'sprint_speed_leaderboard' which fetches sprint speed data using the pybaseball library and handles filtering and formatting.
    def sprint_speed_leaderboard(
        year: int,
        min_opportunities: int = 10,
        player_name: str | None = None,
    ) -> str:
        """Get the Statcast sprint speed leaderboard.
    
        Returns each player's sprint speed in feet per second, measured on
        competitive running plays. Sprint speed is one of the best measures
        of raw speed and baserunning ability.
    
        Args:
            year: Season year (e.g. 2024).
            min_opportunities: Minimum competitive run opportunities (default 10).
            player_name: Optional. Filter to one player (e.g. 'Ronald Acuna Jr.').
    
        Great for finding the fastest players in baseball.
        """
        from pybaseball import statcast_sprint_speed as _fn
    
        try:
            data = _fn(year, min_opp=min_opportunities)
        except Exception as e:
            return f"Error fetching sprint speed data: {e}"
    
        if player_name:
            try:
                data = _filter_player_rows(data, player_name)
            except ValueError as e:
                return str(e)
            if data.empty:
                return (
                    f"No sprint speed row for {player_name} in {year} at "
                    f"{min_opportunities}+ opportunities."
                )
    
        return _fmt(data, max_rows=50)

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/alex-rimerman/statcast-mcp'

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