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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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)
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description carries full burden. It adds valuable domain context by defining what a 'barrel' is and listing return metrics. However, it omits behavioral constraints like Statcast data availability years, rate limits, or error handling when a player_name is not found.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections: purpose, return values, domain definition (barrel), Args documentation, and use case. Every sentence adds value; the barrel definition is essential domain knowledge, and examples are provided without verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 3 simple parameters and existence of output schema, the description is nearly complete. It covers all undocumented parameters and explains key terminology. Minor gap: lacks data availability constraints (e.g., Statcast tracking years) which are relevant for the 'year' parameter.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% (properties lack descriptions), but the description fully compensates via the 'Args:' section. It documents all 3 parameters with clear semantics, examples ('2024', 'Aaron Judge'), and default values (min_batted_ball_events default 50).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with specific verb 'Get' and resource 'exit velocity and barrel rate leaderboard for batters', clearly distinguishing from sibling 'statcast_pitcher_exitvelo_barrels' and broader 'statcast_batter'. Lists specific metrics returned (avg exit velocity, max exit velocity, barrel percentage) to reinforce scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides implicit usage context ('Great for finding the hardest hitters and best contact quality') suggesting when to select it, but lacks explicit comparisons to siblings like 'statcast_batter_expected_stats' or 'batting_stats_date_range' for alternative use cases. No 'when not to use' guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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