Skip to main content
Glama
alex-rimerman

Statcast MCP Server

statcast_pitcher

Retrieve detailed pitch-level data for MLB pitchers, including pitch types, velocity, spin rates, movement metrics, and exit velocity allowed, to analyze performance trends over specified date ranges.

Instructions

Get pitch-level Statcast data for a specific pitcher in a date range.

Returns every pitch thrown — pitch type, velocity, spin rate, movement, exit velocity allowed, and more.

Args: player_name: Full name of the pitcher (e.g. 'Gerrit Cole'). start_date: Start date in YYYY-MM-DD format. end_date: End date in YYYY-MM-DD format (defaults to start_date).

Great for analyzing a pitcher's stuff, outings, or trends over time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
player_nameYes
start_dateYes
end_dateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The statcast_pitcher tool handler, decorated with @mcp.tool(), which fetches pitch-level data for a specific pitcher.
    @mcp.tool()
    def statcast_pitcher(
        player_name: str,
        start_date: str,
        end_date: str | None = None,
    ) -> str:
        """Get pitch-level Statcast data for a specific pitcher in a date range.
    
        Returns every pitch thrown — pitch type, velocity, spin rate, movement,
        exit velocity allowed, and more.
    
        Args:
            player_name: Full name of the pitcher (e.g. 'Gerrit Cole').
            start_date: Start date in YYYY-MM-DD format.
            end_date: End date in YYYY-MM-DD format (defaults to start_date).
    
        Great for analyzing a pitcher's stuff, outings, or trends over time.
        """
        from pybaseball import statcast_pitcher as _sp
    
        try:
            mlbam_id, name = _resolve_player(player_name)
        except ValueError as e:
            return str(e)
    
        if end_date is None:
            end_date = start_date
    
        try:
            data = _sp(start_dt=start_date, end_dt=end_date, player_id=mlbam_id)
        except Exception as e:
            return f"Error fetching data for {player_name}: {e}"
    
        data = _trim_pitch_cols(data)
        return (
            f"Statcast pitching data for {name} (MLBAM ID: {mlbam_id}):\n\n"
            + _fmt(data, max_rows=100)
        )
    
    
    # ---------------------------------------------------------------------------
    # Tools — Season-Level Stats (FanGraphs)
    # ---------------------------------------------------------------------------
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 of behavioral disclosure. It effectively communicates the granularity ('Returns every pitch thrown') and previews data fields (velocity, spin rate, etc.), which helps agents anticipate response volume. However, it omits operational constraints like rate limits, maximum date ranges, or error conditions when a player 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.

Conciseness4/5

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

The description is well-structured with clear sectioning: purpose, return value specification, Args documentation, and usage context. There is minimal fluff, though the 'Great for...' sentence could be more formal. The Args section efficiently packs necessary schema details without redundancy.

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

Completeness3/5

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

Considering the presence of an output schema (reducing the need for detailed return documentation) and the compensation for zero schema coverage via the Args section, the description is adequate for basic invocation. However, it lacks completeness regarding edge cases, such as date range limitations, name normalization rules, or handling of off-season date ranges.

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

Parameters4/5

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

Given 0% schema description coverage, the Args section effectively compensates by providing type semantics and formats (e.g., 'YYYY-MM-DD format') and an example value ('Gerrit Cole'). It also documents the default behavior for end_date, which is critical for optional parameter understanding.

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 precise action ('Get pitch-level Statcast data'), identifies the resource (pitcher-specific data), and scopes it (date range). The 'pitch-level' qualifier effectively distinguishes this from sibling aggregate tools like statcast_pitcher_arsenal_stats or pitching_stats_date_range.

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 context ('Great for analyzing a pitcher's stuff, outings, or trends'), helping agents understand when to select it. However, it lacks explicit guidance on when NOT to use this versus alternatives like statcast_search or the aggregated arsenal stats tools, leaving ambiguity about which pitcher tool is appropriate.

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