Skip to main content
Glama
alex-rimerman

Statcast MCP Server

season_pitching_stats

Retrieve comprehensive season-level pitching statistics including ERA, FIP, WHIP, and WAR from FanGraphs to analyze performance, compare pitchers, and identify leaders.

Instructions

Get season-level pitching statistics from FanGraphs.

Returns comprehensive stats: ERA, FIP, WHIP, K/9, BB/9, WAR, and many more for every qualifying pitcher.

Args: start_season: First season to include (e.g. 2024). end_season: Last season to include. Omit for a single year. min_innings: Minimum innings pitched to qualify. Leave blank to use the FanGraphs default qualified threshold. player_name: Optional. Filter to one pitcher (e.g. 'Gerrit Cole').

Great for finding pitching leaders, comparing pitchers, or analyzing a season.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_seasonYes
end_seasonNo
min_inningsNo
player_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `season_pitching_stats` function is decorated with `@mcp.tool()` and handles the fetching and formatting of pitching statistics using `pybaseball`.
    @mcp.tool()
    def season_pitching_stats(
        start_season: int,
        end_season: int | None = None,
        min_innings: int | None = None,
        player_name: str | None = None,
    ) -> str:
        """Get season-level pitching statistics from FanGraphs.
    
        Returns comprehensive stats: ERA, FIP, WHIP, K/9, BB/9, WAR,
        and many more for every qualifying pitcher.
    
        Args:
            start_season: First season to include (e.g. 2024).
            end_season: Last season to include. Omit for a single year.
            min_innings: Minimum innings pitched to qualify.
                Leave blank to use the FanGraphs default qualified threshold.
            player_name: Optional. Filter to one pitcher (e.g. 'Gerrit Cole').
    
        Great for finding pitching leaders, comparing pitchers, or analyzing a season.
        """
        from pybaseball import pitching_stats
    
        if end_season is None:
            end_season = start_season
    
        try:
            data = pitching_stats(start_season, end_season, qual=min_innings)
        except Exception as e:
            return f"Error fetching pitching stats: {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 FanGraphs pitching row for {player_name} in {start_season}-{end_season} "
                    "with the given IP threshold."
                )
    
        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 behavioral traits by listing example metrics returned (ERA, FIP, WHIP, etc.) and explaining the 'qualifying pitcher' concept tied to min_innings. It could improve by mentioning data volume expectations or rate limiting, but covers the essential return 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?

The description is well-structured and front-loaded: purpose statement first, return value summary second, then the Args section, closing with use-case sentences. There is no wasted language; every sentence earns its place by adding information not present in the structured schema.

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 4 parameters with zero schema coverage, the Args section provides complete documentation. Since an output schema exists, the description appropriately does not fully document return values, though listing example stats is helpful. Minor gap: could explicitly contrast with the date_range variant for completeness.

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?

With 0% schema description coverage, the description fully compensates via the Args section. It provides clear semantics for all 4 parameters: start_season includes an example (2024), end_season explains the omit-for-single-year behavior, min_innings clarifies the 'leave blank for default' logic, and player_name provides a concrete example ('Gerrit Cole').

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-resource combination ('Get season-level pitching statistics from FanGraphs') that clearly distinguishes it from siblings like season_batting_stats (pitching vs. batting) and pitching_stats_date_range (season-level aggregates vs. date ranges). It also specifies the data source (FanGraphs) distinguishing it from Statcast-based siblings.

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 implied usage context ('Great for finding pitching leaders, comparing pitchers, or analyzing a season'), but lacks explicit guidance on when to use this versus pitching_stats_date_range for partial seasons, or whether to use player_lookup first for name resolution. It does not state exclusions or prerequisites.

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