Skip to main content
Glama
alex-rimerman

Statcast MCP Server

statcast_batter_exitvelo_barrels

Analyze baseball batter performance by retrieving exit velocity and barrel rate leaderboards to identify top hitters based on contact quality metrics.

Instructions

Get exit velocity and barrel rate leaderboard for batters.

Returns average exit velocity, max exit velocity, barrel percentage, hard-hit rate, and batted ball quality metrics. A 'barrel' is a batted ball with the ideal combination of exit velocity and launch angle that almost always results in a hit.

Args: year: Season year (e.g. 2024). min_batted_ball_events: Minimum batted ball events to qualify (default 50). player_name: Optional. Filter to one batter (e.g. 'Aaron Judge').

Great for finding the hardest hitters and best contact quality in baseball.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYes
min_batted_ball_eventsNo
player_nameNo

Implementation Reference

  • Tool handler for 'statcast_batter_exitvelo_barrels', which fetches batter exit velocity and barrel data from pybaseball and formats the results.
    def statcast_batter_exitvelo_barrels(
        year: int,
        min_batted_ball_events: int = 50,
        player_name: str | None = None,
    ) -> str:
        """Get exit velocity and barrel rate leaderboard for batters.
    
        Returns average exit velocity, max exit velocity, barrel percentage,
        hard-hit rate, and batted ball quality metrics. A 'barrel' is a
        batted ball with the ideal combination of exit velocity and launch angle
        that almost always results in a hit.
    
        Args:
            year: Season year (e.g. 2024).
            min_batted_ball_events: Minimum batted ball events to qualify (default 50).
            player_name: Optional. Filter to one batter (e.g. 'Aaron Judge').
    
        Great for finding the hardest hitters and best contact quality in baseball.
        """
        from pybaseball import statcast_batter_exitvelo_barrels as _fn
    
        try:
            data = _fn(year, minBBE=min_batted_ball_events)
        except Exception as e:
            return f"Error fetching exit velocity 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 exit-velocity/barrel row for {player_name} in {year} at "
                    f"{min_batted_ball_events}+ batted ball events."
                )
    
        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