$npx -y skills add machina-sports/sports-skills --skill mlb-dataMLB data via ESPN public endpoints — scores, standings, rosters, schedules, game summaries, play-by-play, win probability, injuries, transactions, depth charts, team/player stats, leaders, and news. Zero config, no API keys. Use when: user asks about MLB scores, standings, team r
| 1 | # MLB Data |
| 2 | |
| 3 | Before writing queries, consult `references/api-reference.md` for endpoints, ID conventions, and data shapes. |
| 4 | |
| 5 | ## Setup |
| 6 | |
| 7 | Before first use, check if the CLI is available: |
| 8 | ```bash |
| 9 | which sports-skills || pip install sports-skills |
| 10 | ``` |
| 11 | If `pip install` fails with a Python version error, the package requires Python 3.10+. Find a compatible Python: |
| 12 | ```bash |
| 13 | python3 --version # check version |
| 14 | # If < 3.10, try: python3.12 -m pip install sports-skills |
| 15 | # On macOS with Homebrew: /opt/homebrew/bin/python3.12 -m pip install sports-skills |
| 16 | ``` |
| 17 | No API keys required. |
| 18 | |
| 19 | ## Quick Start |
| 20 | |
| 21 | Prefer the CLI — it avoids Python import path issues: |
| 22 | ```bash |
| 23 | sports-skills mlb get_scoreboard |
| 24 | sports-skills mlb get_standings --season=2025 |
| 25 | sports-skills mlb get_teams |
| 26 | ``` |
| 27 | |
| 28 | ## CRITICAL: Before Any Query |
| 29 | |
| 30 | CRITICAL: Before calling any data endpoint, verify: |
| 31 | - Season year is derived from the system prompt's `currentDate` — never hardcoded. |
| 32 | - If only a team name is provided, call `get_teams` to resolve the team ID before using team-specific commands. |
| 33 | |
| 34 | ## Choosing the Season |
| 35 | |
| 36 | Derive the active season from the system prompt's date — not just the calendar year. |
| 37 | |
| 38 | - **If the user specifies a season**, use it as-is. |
| 39 | - **If the user says "current", "this season", or doesn't specify**: The MLB season runs late March/April through October. If the current month is January–March, the last completed season was the prior calendar year. From April onward, use the current calendar year. |
| 40 | |
| 41 | ## Commands |
| 42 | |
| 43 | | Command | Description | |
| 44 | |---|---| |
| 45 | | `get_scoreboard` | Live/recent MLB scores | |
| 46 | | `get_standings` | Standings by league and division | |
| 47 | | `get_teams` | All 30 MLB teams | |
| 48 | | `get_team_roster` | Full roster for a team | |
| 49 | | `get_team_schedule` | Schedule for a specific team | |
| 50 | | `get_game_summary` | Detailed box score and scoring plays | |
| 51 | | `get_leaders` | MLB statistical leaders | |
| 52 | | `get_news` | MLB news articles | |
| 53 | | `get_play_by_play` | Full play-by-play for a game | |
| 54 | | `get_win_probability` | Win probability chart data | |
| 55 | | `get_schedule` | Schedule for a specific date or season | |
| 56 | | `get_injuries` | Injury reports across all teams | |
| 57 | | `get_transactions` | Recent transactions | |
| 58 | | `get_depth_chart` | Depth chart for a team | |
| 59 | | `get_team_stats` | Team statistical profile | |
| 60 | | `get_player_stats` | Player statistical profile | |
| 61 | |
| 62 | See `references/api-reference.md` for full parameter lists and return shapes. |
| 63 | |
| 64 | ## Examples |
| 65 | |
| 66 | Example 1: Today's scores |
| 67 | User says: "What are today's MLB scores?" |
| 68 | Actions: |
| 69 | 1. Call `get_scoreboard()` |
| 70 | Result: All live and recent MLB games with scores by inning and status |
| 71 | |
| 72 | Example 2: Division standings |
| 73 | User says: "Show me the AL East standings" |
| 74 | Actions: |
| 75 | 1. Derive season year from `currentDate` |
| 76 | 2. Call `get_standings(season=<derived_year>)` |
| 77 | 3. Filter results for American League East |
| 78 | Result: AL East standings with W-L, PCT, GB, run differential |
| 79 | |
| 80 | Example 3: Team roster |
| 81 | User says: "Who's on the Yankees roster?" |
| 82 | Actions: |
| 83 | 1. Call `get_team_roster(team_id="10")` |
| 84 | Result: Full Yankees roster with name, position, bats/throws, height, weight |
| 85 | |
| 86 | Example 4: Game box score |
| 87 | User says: "Show me the full box score for last night's Dodgers game" |
| 88 | Actions: |
| 89 | 1. Call `get_scoreboard(date="<yesterday>")` to find the event_id |
| 90 | 2. Call `get_game_summary(event_id=<id>)` for full box score |
| 91 | Result: Complete box score with batting/pitching stats per player |
| 92 | |
| 93 | Example 5: Injury report |
| 94 | User says: "Who's on the IL for the Yankees?" |
| 95 | Actions: |
| 96 | 1. Call `get_injuries()` |
| 97 | 2. Filter results for New York Yankees (team_id=10) |
| 98 | Result: Yankees IL list with player name, position, IL type, and injury detail |
| 99 | |
| 100 | Example 6: Player statistics |
| 101 | User says: "Show me Shohei Ohtani's stats" |
| 102 | Actions: |
| 103 | 1. Derive season year from `currentDate` |
| 104 | 2. Call `get_player_stats(player_id="39832", season_year=<derived_year>)` |
| 105 | Result: Season stats by category (batting, pitching) with value, rank, and per-game averages |
| 106 | |
| 107 | ## Commands that DO NOT exist — never call these |
| 108 | |
| 109 | - ~~`get_odds`~~ / ~~`get_betting_odds`~~ — not available. For prediction market odds, use the polymarket or kalshi skill. |
| 110 | - ~~`search_ |