Skip to main content
Glama
alex-rimerman

Statcast MCP Server

player_lookup

Find MLB player IDs and career details by entering a player's name. Use this tool to verify identities and obtain database identifiers for subsequent baseball data queries.

Instructions

Look up a baseball player to find their MLBAM ID, years active, and database IDs.

Accepts names like 'Mike Trout', 'Trout, Mike', or 'Shohei Ohtani'. Useful for verifying a player's identity or finding their MLBAM / FanGraphs / Baseball-Reference IDs before running other queries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
player_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `player_lookup` function takes a player name, performs a fuzzy search using `pybaseball.playerid_lookup`, and returns a formatted markdown table of results including names, MLBAM ID, and other database keys.
        return _fmt(data, max_rows=50)
    
    
    # ---------------------------------------------------------------------------
    # Tools — Date-range stats (Baseball Reference via pybaseball)
    # ---------------------------------------------------------------------------
    
    
    @mcp.tool()
    def batting_stats_date_range(
        start_date: str,
        end_date: str,
        player_name: str | None = None,
    ) -> str:
        """Batting stats aggregated over a custom date range (Baseball Reference).
    
        Use for hot/cold streaks, post-deadline samples, or any window between two dates.
    
        Args:
            start_date: Start date YYYY-MM-DD (2008+).
            end_date: End date YYYY-MM-DD (inclusive).
            player_name: Optional. Filter to one player (matches BRef ``Name`` / ``mlbID``).
    
        Returns rate stats (AVG, OBP, SLG, OPS) and counting stats for that span.
        Row limit applies — many players may qualify in long ranges.
        """
        from pybaseball import batting_stats_range as _fn
    
        try:
            data = _fn(start_date, end_date)
        except Exception as e:
            return f"Error fetching batting stats for date range: {e}"
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. It discloses input formats and return values but lacks explicit safety declarations (read-only status), error handling details, or rate limiting information that would help an agent understand operational constraints.

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?

Three well-structured sentences with zero waste: purpose/outputs first, input formats second, usage context third. Every sentence earns its place and follows logical progression.

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 existence of an output schema and simple single-parameter input, the description is appropriately complete. It identifies the specific database IDs returned (MLBAM, FanGraphs, Baseball-Reference) which contextualizes the tool within the baseball data ecosystem.

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?

The schema has 0% description coverage (only 'Player Name' as title). The description compensates effectively by providing concrete input examples ('Mike Trout', 'Trout, Mike', 'Shohei Ohtani'), clarifying the expected name formats beyond the bare schema.

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 specific action (look up), resource (baseball player), and outputs (MLBAM ID, years active, database IDs). It effectively distinguishes this identity-resolution tool from its sibling statistics tools.

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?

The description provides clear guidance on when to use the tool ('before running other queries'), positioning it as a prerequisite for the sibling stats tools. However, it does not explicitly name specific alternatives or state when NOT to use it.

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