Skip to main content
Glama
alex-rimerman

Statcast MCP Server

statcast_pitcher_arsenal_stats

Analyze pitcher performance by pitch type with batting average, slugging, whiff rate, and run values to evaluate effectiveness of specific pitches.

Instructions

Get performance stats broken down by pitch type for each pitcher.

Shows batting average, slugging, whiff rate, put-away rate, and run values for every individual pitch type a pitcher throws.

Args: year: Season year (e.g. 2024). min_plate_appearances: Minimum PA for each pitch type (default 25). player_name: Optional. Filter to one pitcher (all their pitch types).

Great for evaluating which specific pitches are most (or least) effective.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYes
min_plate_appearancesNo
player_nameNo

Implementation Reference

  • The handler function `statcast_pitcher_arsenal_stats` is defined in `src/statcast_mcp/server.py`. It uses the `pybaseball` library to fetch data and applies filtering if a player name is provided.
    def statcast_pitcher_arsenal_stats(
        year: int,
        min_plate_appearances: int = 25,
        player_name: str | None = None,
    ) -> str:
        """Get performance stats broken down by pitch type for each pitcher.
    
        Shows batting average, slugging, whiff rate, put-away rate, and run values
        for every individual pitch type a pitcher throws.
    
        Args:
            year: Season year (e.g. 2024).
            min_plate_appearances: Minimum PA for each pitch type (default 25).
            player_name: Optional. Filter to one pitcher (all their pitch types).
    
        Great for evaluating which specific pitches are most (or least) effective.
        """
        from pybaseball import statcast_pitcher_arsenal_stats as _fn
    
        try:
            data = _fn(year, minPA=min_plate_appearances)
        except Exception as e:
            return f"Error fetching arsenal stats: {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 pitcher arsenal stats for {player_name} in {year} at "
                    f"{min_plate_appearances}+ PA per pitch type."
                )
    
        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