Skip to main content
Glama

mlb-api-mcp

MIT License
25
  • Apple

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
get_mlb_standings

Get current MLB standings for a given season (year).

Args: season (Optional[int]): The year for which to retrieve standings. Defaults to current year. standingsTypes (Optional[str]): The type of standings to retrieve (e.g., 'regularSeason', 'wildCard', etc.). date (Optional[str]): Date in 'YYYY-MM-DD' format. hydrate (Optional[str]): Additional data to hydrate in the response. fields (Optional[str]): Comma-separated list of fields to include in the response. league (str): Filter by league. Accepts 'AL', 'NL', or 'both' (default: 'both').

Returns: dict: Standings for the specified league(s) and season.

get_mlb_schedule

Get MLB schedule for a specific date range, sport ID, or team (ID or name).

Args: sport_id (int): Sport ID (default: 1 for MLB). start_date (str): Start date in 'YYYY-MM-DD' format. Required. end_date (str): End date in 'YYYY-MM-DD' format. Required. team (Optional[str]): Team ID or team name as a string. Can be numeric string, full name, abbreviation, or location. If not provided, defaults to all teams.

Returns: dict: Schedule data for the specified parameters.

get_mlb_team_info

Get information about a specific team by ID or name.

Args: team (str): Team ID or team name as a string. Can be numeric string, full name, abbreviation, or location. season (Optional[int]): Season year. sport_id (Optional[int]): Sport ID. hydrate (Optional[str]): Additional data to hydrate. fields (Optional[str]): Comma-separated list of fields to include.

Returns: dict: Team information.

get_mlb_player_info

Get information about a specific player by ID.

Args: player_id (int): The player ID.

Returns: dict: Player information.

get_mlb_boxscore

Get boxscore for a specific game by game_id.

Args: game_id (int): The game ID. timecode (Optional[str]): Specific timecode for the boxscore snapshot. fields (Optional[str]): Comma-separated list of fields to include.

Returns: dict: Boxscore information.

get_multiple_mlb_player_stats

Get player stats by comma separated player_ids, group, type, season, and optional eventType.

Args: player_ids (str): Comma-separated list of player IDs. group (Optional[str]): Stat group (e.g., hitting, pitching). type (Optional[str]): Stat type (e.g., season, career). season (Optional[int]): Season year. eventType (Optional[str]): Event type filter.

Returns: dict: Player statistics.

get_mlb_sabermetrics

Get sabermetric statistics (including WAR) for multiple players for a specific season.

Args: player_ids (str): Comma-separated list of player IDs. season (int): Season year. stat_name (Optional[str]): Specific sabermetric stat to extract (e.g., 'war', 'woba', 'wRc'). group (str): Stat group ('hitting' or 'pitching').

Returns: dict: Sabermetric statistics.

get_mlb_game_highlights

Get game highlights for a specific game by game_id.

Args: game_id (int): The game ID.

Returns: dict: Game highlights.

get_mlb_game_pace

Get game pace statistics for a given season.

Args: season (int): Season year. sport_id (int): Sport ID (default: 1 for MLB).

Returns: dict: Game pace statistics.

get_mlb_game_scoring_plays

Get plays for a specific game by game_id, with optional filtering by eventType.

Args: game_id (int): The game ID. eventType (Optional[str]): Filter plays by this event type (e.g., 'scoring_play', 'home_run'). timecode (Optional[str]): Specific timecode for the play-by-play snapshot. fields (Optional[str]): Comma-separated list of fields to include.

Returns: dict: Game plays, optionally filtered by eventType.

get_mlb_linescore

Get linescore for a specific game by game_id.

Args: game_id (int): The game ID.

Returns: dict: Linescore information.

get_mlb_roster

Get team roster for a specific team (ID or name), with optional filters.

Args: team (str): Team ID or team name as a string. Can be numeric string, full name, abbreviation, or location. date (Optional[str]): Date in 'YYYY-MM-DD' format. If not provided, defaults to today. rosterType (Optional[str]): Filter by roster type (e.g., 40Man, fullSeason, etc.). season (Optional[str]): Filter by single season (year). hydrate (Optional[str]): Additional data to hydrate in the response. fields (Optional[str]): Comma-separated list of fields to include.

Returns: dict: Team roster information.

get_mlb_search_players

Search for players by name.

Args: fullname (str): Player name to search for. sport_id (int): Sport ID (default: 1 for MLB). search_key (str): Search key (default: "fullname").

Returns: dict: Player search results.

get_mlb_players

Get all players for a specific sport.

Args: sport_id (int): Sport ID (default: 1 for MLB). season (Optional[int]): Filter players by a specific season (year).

Returns: dict: All players for the specified sport.

get_mlb_draft

Get draft information for a specific year.

Args: year_id (int): Draft year.

Returns: dict: Draft information.

get_mlb_awards

Get award recipients for a specific award.

Args: award_id (int): Award ID.

Returns: dict: Award recipients.

get_mlb_search_teams

Search for teams by name or ID.

Args: team_name (str): Team name or ID to search for. search_key (str): Search key ("name", "id", or "all").

Returns: dict: Team search results.

get_mlb_teams

Get all teams for a specific sport.

Args: sport_id (int): Sport ID (default: 1 for MLB). season (Optional[int]): Filter teams by a specific season (year).

Returns: dict: All teams for the specified sport.

get_mlb_game_lineup

Get lineup information for a specific game by game_id.

Args: game_id (int): The game ID.

Returns: dict: Game lineup information.

get_statcast_pitcher

Retrieve MLB Statcast data for a single pitcher over a date range.

Parameters

player_id : int MLBAM ID of the pitcher. start_date : str The start date in 'YYYY-MM-DD' format. Required. end_date : str The end date in 'YYYY-MM-DD' format. Required.

Returns

dict Dictionary with Statcast data for the pitcher. If the result is too large, returns an error message.

Notes

Data is sourced from MLB Statcast via pybaseball. See the official documentation for more details: https://github.com/jldbc/pybaseball/tree/master/docs

get_statcast_batter

Retrieve MLB Statcast data for a single batter over a date range.

Parameters

player_id : int MLBAM ID of the batter. start_date : str The start date in 'YYYY-MM-DD' format. Required. end_date : str The end date in 'YYYY-MM-DD' format. Required.

Returns

dict Dictionary with Statcast data for the batter. If the result is too large, returns an error message.

Notes

Data is sourced from MLB Statcast via pybaseball. See the official documentation for more details: https://github.com/jldbc/pybaseball/tree/master/docs

get_statcast_team

Retrieve MLB Statcast data for all players on a team over a date range.

Parameters

team : str Team ID or team name (see MLB team list for valid values). start_date : str The start date in 'YYYY-MM-DD' format. Required. end_date : str The end date in 'YYYY-MM-DD' format. Required. fields: List[str] The field to return. If not provided, defaults to all fields. Available fields: pitch_type, game_date, release_speed, release_pos_x, release_pos_z, player_name, batter, pitcher, events, description, spin_dir, spin_rate_deprecated, break_angle_deprecated, break_length_deprecated, zone, des, game_type, stand, p_throws, home_team, away_team, type, hit_location, bb_type, balls, strikes, game_year, pfx_x, pfx_z, plate_x, plate_z, on_3b, on_2b, on_1b, outs_when_up, inning, inning_topbot, hc_x, hc_y, tfs_deprecated, tfs_zulu_deprecated, umpire, sv_id, vx0, vy0, vz0, ax, ay, az, sz_top, sz_bot, hit_distance_sc, launch_speed, launch_angle, effective_speed, release_spin_rate, release_extension, game_pk, fielder_2, fielder_3, fielder_4, fielder_5, fielder_6, fielder_7, fielder_8, fielder_9, release_pos_y, estimated_ba_using_speedangle, estimated_woba_using_speedangle, woba_value, woba_denom, babip_value, iso_value, launch_speed_angle, at_bat_number, pitch_number, pitch_name, home_score, away_score, bat_score, fld_score, post_away_score, post_home_score, post_bat_score, post_fld_score, if_fielding_alignment, of_fielding_alignment, spin_axis, delta_home_win_exp, delta_run_exp, bat_speed, swing_length, estimated_slg_using_speedangle, delta_pitcher_run_exp, hyper_speed, home_score_diff, bat_score_diff, home_win_exp, bat_win_exp, age_pit_legacy, age_bat_legacy, age_pit, age_bat, n_thruorder_pitcher, n_priorpa_thisgame_player_at_bat, pitcher_days_since_prev_game, batter_days_since_prev_game, pitcher_days_until_next_game, batter_days_until_next_game, api_break_z_with_gravity, api_break_x_arm, api_break_x_batter_in, arm_angle, attack_angle, attack_direction, swing_path_tilt, intercept_ball_minus_batter_pos_x_inches, intercept_ball_minus_batter_pos_y_inches Returns

dict Dictionary with Statcast data for all players on the team. If the result is too large, returns an error message. Notes

This uses the pybaseball statcast function, which returns all Statcast events for the specified team and date range. See the official documentation for more details: https://github.com/jldbc/pybaseball/tree/master/docs

get_current_date

Get the current date.

Returns: str: The current date in YYYY-MM-DD format

get_current_time

Get the current time.

Returns: str: The current time in HH:MM:SS format

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/guillochon/mlb-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server