Skip to main content
Glama
alex-rimerman

Statcast MCP Server

statcast_pitcher_exitvelo_barrels

Analyze pitcher performance by retrieving exit velocity and barrel rates allowed. Identify pitchers who limit hard contact using metrics like average exit velocity, barrel percentage, and hard-hit rate.

Instructions

Get exit velocity and barrel rate allowed by pitchers.

Returns average exit velocity, barrel percentage, and hard-hit rate allowed. Lower values indicate a pitcher who limits hard contact.

Args: year: Season year (e.g. 2024). min_batted_ball_events: Minimum batted ball events against (default 50). player_name: Optional. Filter to one pitcher (e.g. 'Gerrit Cole').

Great for finding pitchers who suppress hard contact most effectively.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYes
min_batted_ball_eventsNo
player_nameNo

Implementation Reference

  • The implementation of the `statcast_pitcher_exitvelo_barrels` tool, which fetches exit velocity and barrel rate data using `pybaseball` and formats the results.
    def statcast_pitcher_exitvelo_barrels(
        year: int,
        min_batted_ball_events: int = 50,
        player_name: str | None = None,
    ) -> str:
        """Get exit velocity and barrel rate allowed by pitchers.
    
        Returns average exit velocity, barrel percentage, and hard-hit rate
        allowed. Lower values indicate a pitcher who limits hard contact.
    
        Args:
            year: Season year (e.g. 2024).
            min_batted_ball_events: Minimum batted ball events against (default 50).
            player_name: Optional. Filter to one pitcher (e.g. 'Gerrit Cole').
    
        Great for finding pitchers who suppress hard contact most effectively.
        """
        from pybaseball import statcast_pitcher_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 against."
                )
    
        return _fmt(data, max_rows=50)
  • The `@mcp.tool()` decorator used to register the function as an MCP tool.
    @mcp.tool()

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