Skip to main content
Glama
alex-rimerman

Statcast MCP Server

statcast_search

Search and retrieve pitch-level MLB Statcast data within specific date ranges, including pitch types, velocities, spin rates, exit velocities, launch angles, and expected statistics. Filter results by team to analyze baseball performance metrics.

Instructions

Search for pitch-level Statcast data within a date range.

Returns pitch-by-pitch data including pitch type, velocity, spin rate, exit velocity, launch angle, expected stats, and more.

Args: start_date: Start date in YYYY-MM-DD format (e.g. '2024-07-04'). end_date: End date in YYYY-MM-DD format. Defaults to start_date for single-day queries. team: Optional three-letter team abbreviation to filter results (e.g. 'NYY', 'LAD', 'BOS').

Data is available from the 2008 season onward. Tip: keep date ranges to 1-5 days for faster results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateYes
end_dateNo
teamNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The statcast_search function is the MCP tool handler for querying pitch-level Statcast data. It leverages pybaseball's statcast function and processes the results with _trim_pitch_cols and _fmt for presentation.
    @mcp.tool()
    def statcast_search(
        start_date: str,
        end_date: str | None = None,
        team: str | None = None,
    ) -> str:
        """Search for pitch-level Statcast data within a date range.
    
        Returns pitch-by-pitch data including pitch type, velocity, spin rate,
        exit velocity, launch angle, expected stats, and more.
    
        Args:
            start_date: Start date in YYYY-MM-DD format (e.g. '2024-07-04').
            end_date: End date in YYYY-MM-DD format. Defaults to start_date for
                      single-day queries.
            team: Optional three-letter team abbreviation to filter results
                  (e.g. 'NYY', 'LAD', 'BOS').
    
        Data is available from the 2008 season onward.
        Tip: keep date ranges to 1-5 days for faster results.
        """
        from pybaseball import statcast
    
        if end_date is None:
            end_date = start_date
    
        try:
            data = statcast(start_dt=start_date, end_dt=end_date, team=team)
        except Exception as e:
            return f"Error fetching Statcast data: {e}"
    
        data = _trim_pitch_cols(data)
        return _fmt(data, max_rows=100)
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 of behavioral disclosure. It successfully explains the return granularity ('pitch-by-pitch data including pitch type, velocity...'), default parameter behavior ('Defaults to start_date'), and performance characteristics (date range tips). It lacks explicit mention of pagination or rate limits, preventing a 5.

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 value description, Args block, and usage tips. Every sentence provides value—defining the data scope, enumerating return fields (critical with output schema present), documenting parameter formats, and providing performance constraints. No wasted words.

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?

Despite 0% schema coverage and no annotations, the description is complete. It covers all parameters with formats, explains return values (pitch-by-pitch granularity), provides temporal constraints (2008+), and includes performance tips. With an output schema present, it appropriately summarizes rather than exhaustively lists return fields.

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 description fully compensates by providing detailed format specifications and examples for all three parameters: date formats ('YYYY-MM-DD', '2024-07-04') and team abbreviations ('NYY', 'LAD', 'BOS'). This is essential since the schema only provides titles.

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 clearly states the tool 'Search[es] for pitch-level Statcast data within a date range,' specifying the verb (search), resource (pitch-level Statcast data), and scope (date range). The 'pitch-level' and 'pitch-by-pitch' qualifiers effectively distinguish it from sibling aggregate tools like batting_stats_date_range or season_pitching_stats.

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 a performance tip ('keep date ranges to 1-5 days for faster results') and notes data availability ('from the 2008 season onward'), but lacks explicit guidance on when to use this vs. player-specific siblings like statcast_batter or statcast_pitcher. It implies bulk/team filtering use cases but does not name alternatives.

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