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
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | ||
| min_batted_ball_events | No | ||
| player_name | No |
Implementation Reference
- src/statcast_mcp/server.py:977-1012 (handler)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) - src/statcast_mcp/server.py:976-976 (registration)The `@mcp.tool()` decorator used to register the function as an MCP tool.
@mcp.tool()