MLB Daily Scores

Daily MLB baseball scores, box scores, starting pitchers, and injury reports for your favourite team. Covers spring training, regular season, and playoffs. R...

MIT-0 · Free to use, modify, and redistribute. No attribution required.
1 · 317 · 0 current installs · 0 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the actual behavior: fetch_mlb.py calls the MLB Stats API and (optionally) requests for injury info. The declared binary (python3), the .venv usage, and pip packages (MLB-StatsAPI, requests) are directly relevant to the stated purpose.
Instruction Scope
SKILL.md instructs the agent to run the bundled fetch_mlb.py from the created .venv and to read the skill config from ~/.openclaw/openclaw.json. Those actions are necessary and proportional to producing the scheduled or on-demand report. The instructions do not ask the agent to access unrelated system files or transmit data to unexpected endpoints; network calls are limited to the MLB Stats API and any endpoints used by requests for injury reports.
Install Mechanism
There is no arbitrary remote archive download. setup.py and setup.sh create a .venv in the skill directory and install MLB-StatsAPI and requests from PyPI. This is a standard, expected install mechanism for a Python skill.
Credentials
The skill declares no required environment variables or credentials. It reads only the OpenClaw config file (~/.openclaw/openclaw.json) for its own skill configuration (team/timezone), which is proportionate to its functionality.
Persistence & Privilege
always is false and the skill runs only when invoked or scheduled. It creates a local .venv inside its own directory and does not request modification of other skills or system-wide config beyond the single OpenClaw config entry it documents.
Assessment
This skill appears to do exactly what it says: create a local virtual environment, install MLB-StatsAPI and requests, read the skill entry in ~/.openclaw/openclaw.json, and query the public MLB Stats API to produce JSON for the agent to format and deliver. Before installing: (1) confirm you’re comfortable the cron/cron-target (--to) used in examples will deliver outputs to the intended channel/recipient; do not supply unrelated credentials or channel IDs you don't trust; (2) review the setup output when pip installs packages (run setup in an isolated environment if you prefer); (3) verify the .venv path and that the agent uses BASEDIR/.venv/bin/python3 as instructed; and (4) if concerned, scan the rest of fetch_mlb.py for any additional network calls (the visible code uses only MLB Stats API and optional requests). No API keys or unrelated system access are requested by this skill.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.13
Download zip
latestvk971m913gzs663fyfab7hqfmys81zvg8

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Runtime requirements

Clawdis
OSmacOS · Linux · Windows
Binspython3

SKILL.md

MLB Daily Scores

Fetches yesterday's game recap and today's upcoming game preview for the user's configured favourite MLB team. Includes spring training, regular season, postseason (Wild Card, Division Series, Championship Series, World Series), and exhibition games.

Data Source

Uses the free MLB Stats API (statsapi.mlb.com). No API key required.

Setup (one-time)

1. Install dependencies

Run the setup script to install the Python packages:

# macOS/Linux
bash {baseDir}/setup.sh

# Any platform (including Windows)
python {baseDir}/setup.py

Or install manually:

pip install --user MLB-StatsAPI requests

2. Configure your team

Add this to ~/.openclaw/openclaw.json under skills.entries:

{
  skills: {
    entries: {
      "mlb-daily-scores": {
        enabled: true,
        config: {
          team: "Toronto Blue Jays", // Your favourite team (full name)
          timezone: "America/Toronto", // Your local timezone (IANA format)
        },
      },
    },
  },
}

Valid team names — use the full official name: Arizona Diamondbacks, Atlanta Braves, Baltimore Orioles, Boston Red Sox, Chicago Cubs, Chicago White Sox, Cincinnati Reds, Cleveland Guardians, Colorado Rockies, Detroit Tigers, Houston Astros, Kansas City Royals, Los Angeles Angels, Los Angeles Dodgers, Miami Marlins, Milwaukee Brewers, Minnesota Twins, New York Mets, New York Yankees, Oakland Athletics, Philadelphia Phillies, Pittsburgh Pirates, San Diego Padres, San Francisco Giants, Seattle Mariners, St. Louis Cardinals, Tampa Bay Rays, Texas Rangers, Toronto Blue Jays, Washington Nationals.

3. Set up the daily cron job

Ask me to set it up, or run manually:

openclaw cron add \
  --name "MLB Daily Scores" \
  --cron "0 6 * * *" \
  --tz "America/Toronto" \
  --session isolated \
  --message "Run the mlb-daily-scores skill for my configured team. Use the fetch_mlb.py script, format the results nicely, and include yesterday's recap, today's preview, and any injuries." \
  --announce \
  --channel discord \
  --to "channel:YOUR_CHANNEL_ID"

Adjust the parameters:

  • --cron "0 6 * * *" — time to run (6:00 AM); change to your preferred time
  • --tz — your timezone
  • --channel — your preferred channel (discord, telegram, whatsapp, slack, etc.)
  • --to — channel-specific target (channel ID, phone number, chat ID, etc.)

How to use

Automatic (cron)

Once the cron job is set up, the skill runs daily at your configured time and delivers the report to your channel.

On demand (slash command)

Send /mlb-daily-scores in any chat to get an immediate update.

Manual invocation

Ask me: "What happened in the Blue Jays game yesterday?" or "Give me today's MLB update"

Instructions for the agent

{baseDir} in these instructions refers to the directory containing this SKILL.md file. Determine this path from the location of this file (e.g., if this file is at /home/openclaw/.openclaw/workspace/skills/mlb-daily-scores/skills/mlb-daily-scores/SKILL.md, then {baseDir} is /home/openclaw/.openclaw/workspace/skills/mlb-daily-scores/skills/mlb-daily-scores).

When this skill is invoked (via cron, slash command, or user request):

  1. Determine the base directory — find the directory where this SKILL.md and fetch_mlb.py are located. Call this BASEDIR.

  2. Read the user's config from skills.entries.mlb-daily-scores.config:

    • team: the MLB team name (required)
    • timezone: IANA timezone string (optional, defaults to system timezone)
  3. Run the fetch script using this EXACT command pattern (replacing BASEDIR with the actual path):

    BASEDIR/.venv/bin/python3 BASEDIR/fetch_mlb.py --config
    

    IMPORTANT: You MUST use the venv Python at BASEDIR/.venv/bin/python3. Do NOT use python, python3, or any other Python interpreter — the required packages are only installed inside the .venv virtual environment. Using any other Python will fail with import errors.

    The --config flag tells the script to read team/timezone directly from ~/.openclaw/openclaw.json. No user values should be interpolated into the command string. This outputs JSON to stdout.

  4. Parse the JSON output and check has_data:

    • If has_data is false and there's no error: it's off-season or a day off. Reply with HEARTBEAT_OK (this suppresses the message in cron/heartbeat mode).
    • If has_data is false and there's an error field: report the error to the user.
    • If has_data is true: format the report as described below.
  5. Format the report using this structure (include game_type from the JSON when it is not Regular Season):

⚾ MLB Daily Report — [Team Name]
📅 [Today's Date]

━━━━━━━━━━━━━━━━━━━━━━━
📊 YESTERDAY'S RECAP [game_type, e.g. "(Spring Training)" — omit if Regular Season]
━━━━━━━━━━━━━━━━━━━━━━━

[Score Line, e.g.: Blue Jays 5, Yankees 3]

  W: [Winning Pitcher]
  L: [Losing Pitcher]
  S: [Save Pitcher, if any]

LINE SCORE:
[Linescore text from the API]

━━━━━━━━━━━━━━━━━━━━━━━
🔮 TODAY'S PREVIEW [game_type, e.g. "(Spring Training)" — omit if Regular Season]
━━━━━━━━━━━━━━━━━━━━━━━

[Opponent] @ [Home Team]
🕐 [Game Time in local timezone]
🏟️ [Venue]

Starting Pitchers:
  [Away Team]: [Pitcher Name] ([W-L], [ERA] ERA)
  [Home Team]: [Pitcher Name] ([W-L], [ERA] ERA)

━━━━━━━━━━━━━━━━━━━━━━━
🏥 INJURY REPORT
━━━━━━━━━━━━━━━━━━━━━━━

[For each injury]:
• [Player Name] ([Position]) — [Injury Description] [Status]

[If no injuries]: ✅ No players currently on the injury list.
  1. Omit sections that have no data:

    • No yesterday game → skip the recap section, note "No game yesterday"
    • No today game → skip the preview section, note "No game scheduled today"
    • No injuries → show the clean bill of health line
  2. Keep the box score concise — include the linescore (innings R/H/E) but NOT the full box score text (it's too long for chat). Only include the full boxscore if the user explicitly asks for more detail.

  3. Off-season handling — If neither yesterday nor today has a game and there are no injuries to report, respond with just HEARTBEAT_OK so no message is delivered. The script covers all game types (spring training, regular season, postseason, exhibition), so true off-season gaps are only mid-November through late February.

Files

6 total
Select a file
Select a file to preview.

Comments

Loading comments…