Skip to main content
Glama
alex-rimerman

Statcast MCP Server

statcast_batter_pitch_arsenal

Analyze batter performance against specific pitch types by retrieving batting statistics like BA, SLG, wOBA, whiff rate, K rate, run value, and hard-hit rate for each pitch type faced.

Instructions

Get batting stats broken down by pitch type for batters.

Returns BA, SLG, wOBA, whiff rate, K rate, run value, and hard-hit rate for each pitch type a batter faced (4-seam, slider, curve, changeup, etc.).

Args: year: Season year (e.g. 2024). player_name: Optional. Filter to a specific batter (e.g. 'Aaron Judge'). If omitted, returns the full leaderboard. min_plate_appearances: Minimum PA per pitch type to qualify (default 10).

Great for analyzing how a hitter performs against fastballs vs. breaking balls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYes
player_nameNo
min_plate_appearancesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool handler 'statcast_batter_pitch_arsenal' fetches batter pitch arsenal data using 'pybaseball.statcast_batter_pitch_arsenal' and formats the output. It includes logic to filter for a specific player if provided.
    @mcp.tool()
    def statcast_batter_pitch_arsenal(
        year: int,
        player_name: str | None = None,
        min_plate_appearances: int = 10,
    ) -> str:
        """Get batting stats broken down by pitch type for batters.
    
        Returns BA, SLG, wOBA, whiff rate, K rate, run value, and hard-hit rate
        for each pitch type a batter faced (4-seam, slider, curve, changeup, etc.).
    
        Args:
            year: Season year (e.g. 2024).
            player_name: Optional. Filter to a specific batter (e.g. 'Aaron Judge').
                If omitted, returns the full leaderboard.
            min_plate_appearances: Minimum PA per pitch type to qualify (default 10).
    
        Great for analyzing how a hitter performs against fastballs vs. breaking balls.
        """
        from pybaseball import statcast_batter_pitch_arsenal as _fn
    
        try:
            data = _fn(year, minPA=min_plate_appearances)
        except Exception as e:
            return f"Error fetching batter pitch arsenal data: {e}"
    
        if player_name:
            try:
                _, display = _resolve_player(player_name)
                data = _filter_player_rows(data, player_name)
            except ValueError as e:
                return str(e)
            if data.empty:
                return (
                    f"No pitch-type batting data for {player_name} in {year} at "
                    f"{min_plate_appearances}+ PA per pitch type."
                )
            header = f"Batting stats by pitch type for {display} ({year}):\n\n"
            return header + _fmt(data, max_rows=50)
    
        return _fmt(data, max_rows=50)
Behavior4/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 effectively discloses return behavior by listing specific metrics returned (BA, SLG, wOBA, whiff rate, etc.) and the breakdown structure (per pitch type). However, it omits explicit safety declarations (read-only vs. destructive) or rate limiting concerns.

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?

The description is well-structured with clear sections: purpose, return values, Args documentation, and use case. Every sentence adds value; no repetition of the tool name or tautological statements. The Args section is efficiently embedded without excessive verbosity.

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

Completeness5/5

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

For a tool with 3 parameters and an output schema, the description is complete. It documents all parameters (compensating for empty schema descriptions), explains the return structure despite the existence of an output schema, and provides contextual usage guidance. No critical gaps remain.

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?

Given 0% schema description coverage, the Args section fully compensates by documenting all 3 parameters with semantics, examples ('2024', 'Aaron Judge'), optionality flags, and default values (min_plate_appearances default 10). This adds substantial meaning beyond the raw schema types.

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') + resource ('batting stats') + granular scope ('broken down by pitch type'). It clearly distinguishes itself from the general 'statcast_batter' sibling by emphasizing the pitch-type granularity (4-seam, slider, etc.).

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?

The description provides positive usage guidance ('Great for analyzing how a hitter performs against fastballs vs. breaking balls'), but lacks explicit negative constraints or alternatives. It does not state when to use the general 'statcast_batter' tool instead, or clarify that this is specifically for pitch-type breakdowns versus aggregate stats.

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