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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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

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

With no annotations provided, the description carries the full burden. It discloses what metrics are returned and adds interpretive context ('Lower values indicate a pitcher who limits hard contact'), but omits operational details like rate limits, data freshness, or caching behavior.

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 front-loading: purpose statement, return value description, behavioral interpretation, parameter documentation (Args), and use case. Every sentence provides distinct value without redundancy.

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 the output schema exists and parameters are well-documented in the description, the coverage is strong. Minor gap: could explicitly reference the sibling batter tool for clarity, but the pitcher/batter distinction is implied through 'allowed by' language.

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%, requiring the description to compensate fully. The Args section documents all three parameters (year, min_batted_ball_events, player_name) with types implied via examples, constraints noted ('Optional'), and defaults mentioned ('default 50'), completely filling the schema documentation gap.

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?

The description opens with a specific verb ('Get') and resource ('exit velocity and barrel rate allowed by pitchers'), clearly distinguishing it from the sibling batter tool (statcast_batter_exitvelo_barrels) by specifying 'allowed by pitchers' (pitcher perspective).

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 implied usage context ('Great for finding pitchers who suppress hard contact most effectively') but lacks explicit when-to-use/when-not-to-use guidance or naming of alternative tools like the batter variant or other pitching stats tools.

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