Skip to main content
Glama
alex-rimerman

Statcast MCP Server

outs_above_average

Retrieve Outs Above Average (OAA) leaderboards to evaluate defensive performance by position in MLB. This tool calculates how many outs a fielder saved compared to an average defender, using parameters like year, position, and minimum attempts.

Instructions

Outs Above Average (OAA) leaderboard by defensive position.

OAA estimates how many outs a fielder saved vs an average defender.

Args: year: Season year (e.g. 2024). position: One of: SS, 2B, 3B, 1B, LF, CF, RF, or ALL (all infield + outfield positions supported by Savant). Not available for catcher in this leaderboard. min_attempts: Minimum fielding attempts, or "q" for qualified (default). player_name: Optional. Filter to one fielder (use a position they actually play).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYes
positionYes
min_attemptsNoq
player_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The outs_above_average function acts as the handler for the tool, retrieving data from pybaseball and formatting the result.
    def outs_above_average(
        year: int,
        position: str,
        min_attempts: str | int = "q",
        player_name: str | None = None,
    ) -> str:
        """Outs Above Average (OAA) leaderboard by defensive position.
    
        OAA estimates how many outs a fielder saved vs an average defender.
    
        Args:
            year: Season year (e.g. 2024).
            position: One of: SS, 2B, 3B, 1B, LF, CF, RF, or ALL (all infield + outfield
                positions supported by Savant). Not available for catcher in this leaderboard.
            min_attempts: Minimum fielding attempts, or "q" for qualified (default).
            player_name: Optional. Filter to one fielder (use a position they actually play).
    
        """
        from pybaseball import statcast_outs_above_average as _fn
    
        pos = position.strip().upper()
        if pos == "ALL":
            pos = "all"
    
        try:
            data = _fn(year, pos, min_att=min_attempts)
        except ValueError as e:
            return str(e)
        except Exception as e:
            return f"Error fetching OAA: {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 OAA row for {player_name} at position {position} in {year}. "
                    "Try position=ALL or a different position."
                )
    
        return _fmt(data, max_rows=50)
Behavior4/5

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

No annotations provided, so description carries full burden. It explains the metric's meaning (outs saved vs. average), notes the catcher's exclusion, and specifies the default value ('q' for qualified). With output schema present, it appropriately focuses on input behavior and domain-specific constraints rather than return values.

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?

Well-structured with purpose upfront, conceptual explanation second, and parameter details in Args section. Front-loaded with the key function. The Args formatting is slightly informal but clear. No redundant sentences.

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?

Given 4 parameters with 0% schema coverage, the description adequately documents all inputs including defaults and constraints. Output schema exists, so return value explanation isn't needed. Covers domain limitations (no catcher data) sufficient for a specialized baseball statistics tool.

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 fully compensate. It successfully documents all 4 parameters: year (with example 2024), position (enumerates all valid values plus ALL), min_attempts (explains 'q' for qualified and notes default), and player_name (notes optional status and usage constraint).

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?

Description clearly states the tool retrieves an 'OAA leaderboard by defensive position' and defines OAA as estimating 'how many outs a fielder saved vs an average defender.' This effectively distinguishes it from batting/pitching siblings (e.g., batting_stats_date_range, pitching_stats_date_range) and the related outfield_directional_oaa tool by specifying this is the general positional leaderboard.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides specific constraints: 'Not available for catcher in this leaderboard' and advises to 'use a position they actually play' when filtering by player_name. While it doesn't explicitly name the outfield_directional_oaa sibling as an alternative, it clearly scopes the valid positions (SS, 2B, 3B, 1B, LF, CF, RF, ALL).

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