mlb-data by machina-sports/sports-skills
npx skills add https://github.com/machina-sports/sports-skills --skill mlb-data在编写查询之前,请查阅 references/api-reference.md 以了解端点、ID 约定和数据格式。
首次使用前,检查 CLI 是否可用:
which sports-skills || pip install sports-skills
如果 pip install 因 Python 版本错误而失败,则该软件包需要 Python 3.10+。请查找兼容的 Python 版本:
python3 --version # 检查版本
# 如果版本 < 3.10,尝试:python3.12 -m pip install sports-skills
# 在 macOS 上使用 Homebrew:/opt/homebrew/bin/python3.12 -m pip install sports-skills
无需 API 密钥。
推荐使用 CLI —— 它可以避免 Python 导入路径问题:
sports-skills mlb get_scoreboard
sports-skills mlb get_standings --season=2025
sports-skills mlb get_teams
关键提示:在调用任何数据端点之前,请验证:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
currentDateget_teams 来解析球队 ID。从系统提示的日期推导出当前赛季 —— 而不仅仅是日历年。
| 命令 | 描述 |
|---|---|
get_scoreboard | MLB 实时/近期比分 |
get_standings | 按联盟和分区的排名 |
get_teams | 所有 30 支 MLB 球队 |
get_team_roster | 球队的完整阵容名单 |
get_team_schedule | 特定球队的赛程 |
get_game_summary | 详细的比分板和得分过程 |
get_leaders | MLB 统计数据领先者 |
get_news | MLB 新闻文章 |
get_play_by_play | 比赛的完整逐场播报 |
get_win_probability | 获胜概率图表数据 |
get_schedule | 特定日期或赛季的赛程 |
get_injuries | 所有球队的伤病报告 |
get_transactions | 近期交易 |
get_depth_chart | 球队的深度图 |
get_team_stats | 球队统计数据概况 |
get_player_stats | 球员统计数据概况 |
完整参数列表和返回格式请参阅 references/api-reference.md。
示例 1:今日比分 用户说:"今天 MLB 的比分是什么?" 操作:
get_scoreboard()
结果:所有 MLB 实时和近期比赛,包含按局比分和状态示例 2:分区排名 用户说:"给我看看美联东区的排名" 操作:
currentDate 推导赛季年份get_standings(season=<derived_year>)示例 3:球队阵容 用户说:"洋基队的阵容有哪些人?" 操作:
get_team_roster(team_id="10")
结果:完整的洋基队阵容,包含姓名、位置、击球/投球手、身高、体重示例 4:比赛比分板 用户说:"给我看看昨晚道奇队比赛的完整比分板" 操作:
get_scoreboard(date="<yesterday>") 以找到 event_idget_game_summary(event_id=<id>) 获取完整比分板
结果:完整的比分板,包含每位球员的击球/投球统计数据示例 5:伤病报告 用户说:"洋基队的伤病名单上有谁?" 操作:
get_injuries()示例 6:球员统计数据 用户说:"给我看看大谷翔平的统计数据" 操作:
currentDate 推导赛季年份get_player_stats(player_id="39832", season_year=<derived_year>)
结果:按类别(击球、投球)的赛季统计数据,包含数值、排名和场均平均值get_oddsget_betting_oddssearch_teamsget_teams。get_box_scoreget_game_summary。get_player_ratingsget_player_stats。如果某个命令未在上方的命令表中列出,则它不存在。
当命令失败时,不要向用户显示原始错误信息。而是:
get_teams 查找 ID错误:sports-skills 命令未找到
原因:软件包未安装
解决方案:运行 pip install sports-skills
错误:未通过 ID 找到球队
原因:使用了错误或过时的 ESPN 球队 ID
解决方案:调用 get_teams 获取所有 30 支 MLB 球队及其 ID 的当前列表
错误:未来比赛未返回数据
原因:ESPN 仅返回已完成或正在进行的比赛数据
解决方案:使用 get_schedule 查看即将到来的比赛详情;get_scoreboard 仅涵盖活跃/近期比赛
错误:休赛期 —— 比分板返回 0 个事件
原因:休赛期(11 月至 3 月)没有比赛安排
解决方案:请改用 get_standings 或 get_news;MLB 休赛期交易可通过 get_transactions 获取
每周安装量
95
代码仓库
GitHub 星标数
55
首次出现
2026年2月19日
安全审计
安装于
opencode92
codex92
gemini-cli91
cursor91
github-copilot89
amp88
Before writing queries, consult references/api-reference.md for endpoints, ID conventions, and data shapes.
Before first use, check if the CLI is available:
which sports-skills || pip install sports-skills
If pip install fails with a Python version error, the package requires Python 3.10+. Find a compatible Python:
python3 --version # check version
# If < 3.10, try: python3.12 -m pip install sports-skills
# On macOS with Homebrew: /opt/homebrew/bin/python3.12 -m pip install sports-skills
No API keys required.
Prefer the CLI — it avoids Python import path issues:
sports-skills mlb get_scoreboard
sports-skills mlb get_standings --season=2025
sports-skills mlb get_teams
CRITICAL: Before calling any data endpoint, verify:
currentDate — never hardcoded.get_teams to resolve the team ID before using team-specific commands.Derive the active season from the system prompt's date — not just the calendar year.
| Command | Description |
|---|---|
get_scoreboard | Live/recent MLB scores |
get_standings | Standings by league and division |
get_teams | All 30 MLB teams |
get_team_roster | Full roster for a team |
get_team_schedule | Schedule for a specific team |
get_game_summary | Detailed box score and scoring plays |
See references/api-reference.md for full parameter lists and return shapes.
Example 1: Today's scores User says: "What are today's MLB scores?" Actions:
get_scoreboard() Result: All live and recent MLB games with scores by inning and statusExample 2: Division standings User says: "Show me the AL East standings" Actions:
currentDateget_standings(season=<derived_year>)Example 3: Team roster User says: "Who's on the Yankees roster?" Actions:
get_team_roster(team_id="10") Result: Full Yankees roster with name, position, bats/throws, height, weightExample 4: Game box score User says: "Show me the full box score for last night's Dodgers game" Actions:
get_scoreboard(date="<yesterday>") to find the event_idget_game_summary(event_id=<id>) for full box score Result: Complete box score with batting/pitching stats per playerExample 5: Injury report User says: "Who's on the IL for the Yankees?" Actions:
get_injuries()Example 6: Player statistics User says: "Show me Shohei Ohtani's stats" Actions:
currentDateget_player_stats(player_id="39832", season_year=<derived_year>) Result: Season stats by category (batting, pitching) with value, rank, and per-game averagesget_oddsget_betting_oddssearch_teamsget_teams instead.get_box_scoreget_game_summary instead.get_player_ratingsget_player_stats instead.If a command is not listed in the Commands table above, it does not exist.
When a command fails, do not surface raw errors to the user. Instead:
get_teams to find the ID firstError: sports-skills command not found Cause: Package not installed Solution: Run pip install sports-skills
Error: Team not found by ID Cause: Wrong or outdated ESPN team ID used Solution: Call get_teams to get the current list of all 30 MLB teams with their IDs
Error: No data returned for a future game Cause: ESPN only returns data for completed or in-progress games Solution: Use get_schedule to see upcoming game details; get_scoreboard only covers active/recent games
Error: Offseason — scoreboard returns 0 events Cause: No games scheduled during the offseason (November–March) Solution: Use get_standings or get_news instead; MLB offseason transactions are available via get_transactions
Weekly Installs
95
Repository
GitHub Stars
55
First Seen
Feb 19, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode92
codex92
gemini-cli91
cursor91
github-copilot89
amp88
DOCX文件创建、编辑与分析完整指南 - 使用docx-js、Pandoc和Python脚本
51,800 周安装
get_leaders | MLB statistical leaders |
get_news | MLB news articles |
get_play_by_play | Full play-by-play for a game |
get_win_probability | Win probability chart data |
get_schedule | Schedule for a specific date or season |
get_injuries | Injury reports across all teams |
get_transactions | Recent transactions |
get_depth_chart | Depth chart for a team |
get_team_stats | Team statistical profile |
get_player_stats | Player statistical profile |