MLB League State Reader
Table of Contents
Example
Scenario: Morning brief run on 2026-04-17. Coach needs current roster, matchup, FAAB, and standings before launching lineup-optimizer.
Inputs read first:
yahoo-mlb/context/league-config.md (league ID 23756, team 5, 12 teams, 5x5 cats)
yahoo-mlb/context/team-profile.md (prior known roster skeleton)
Chrome navigation sequence (authenticated):
https://baseball.fantasysports.yahoo.com/b1/23756/5 — roster with today's opponents per player
https://baseball.fantasysports.yahoo.com/b1/23756?lhst=stand — standings + category ranks
https://baseball.fantasysports.yahoo.com/b1/23756/matchup — this week's head-to-head vs Los Doyers
https://baseball.fantasysports.yahoo.com/b1/23756/transactions — FAAB spent to date → remaining
https://baseball.fantasysports.yahoo.com/b1/23756/players?status=A — top free agents (page 1)
Extracted bundle:
| Field |
Value |
| Record |
8-6-1 |
| Rank |
5 of 12 |
| FAAB spent |
$14 |
| FAAB remaining |
$86 |
| This week opp |
Los Doyers |
| Live matchup score |
4-3-3 (us leading R, HR, K; losing OBP, ERA, WHIP) |
| Roster returned |
26 of 26 slots populated |
| Free agents top-20 |
captured for waiver-analyst |
Outputs written:
context/team-profile.md — roster snapshot updated in place (slot, player, MLB team, today's opp, status)
signals/2026-04-17-league-state.md — signal file with YAML frontmatter, source_urls, confidence
Every downstream agent (lineup-optimizer, waiver-analyst, category-strategist) now reads this signal file and team-profile.md rather than re-scraping Yahoo.
Workflow
Copy this checklist and track progress:
League State Reader Progress:
- [ ] Step 1: Read context files (league-config.md + team-profile.md)
- [ ] Step 2: Pull Yahoo pages via Claude-in-Chrome (5 URLs)
- [ ] Step 3: Parse roster, standings, matchup, FAAB, free agents
- [ ] Step 4: Update team-profile.md in place
- [ ] Step 5: Emit signal file with frontmatter + source_urls
Step 1: Read context files
Load the authoritative contract and the last known state before touching Yahoo. This both verifies the league ID/URL and provides the skeleton to diff against.
Step 2: Pull Yahoo pages via Claude-in-Chrome
The user is already authenticated in the browser. Navigate in order; parse page text; if any step fails, jump to Degraded Mode for that specific URL only (do not abort the whole run). See resources/methodology.md for the exact tool-call sequence and page-parsing patterns.
Step 3: Parse and normalize
Extract structured data from each page. See resources/methodology.md for row-level parsing logic, and resources/methodology.md for how to reconstruct FAAB remaining from the transactions log.
Step 4: Update team-profile.md in place
See resources/template.md for the exact output shape. Overwrite the existing file (not append); this file is meant to always reflect "as of the latest run."
Step 5: Emit signal file
Write yahoo-mlb/signals/YYYY-MM-DD-league-state.md with YAML frontmatter per the signal framework. Every URL navigated must appear in source_urls. Degraded fetches drop confidence to 0.5; full-failure fields drop to 0.3 and are flagged. See resources/template.md.
Degraded Mode
Chrome can fail for several reasons: tab not open, session expired, Yahoo rate-limiting, 500 error, unreadable DOM. Never abort the whole run. Fail gracefully per-URL.
Per-URL fallback decision tree:
| Failure |
Fallback |
| Navigation error / timeout |
Retry once. If still failing, ask user: "Paste the contents of {URL} and I'll parse from that." |
| Session expired (login page returned) |
Ask user: "Please log into Yahoo in your Chrome tab, then say 'retry'." Do not attempt to re-authenticate. |
| Page loads but parse fails (unknown layout) |
Dump the first ~4000 chars of get_page_text into the signal file under raw_capture: and drop confidence to 0.4 for that field. |
| Free-agents page gated / empty |
Mark free_agents: [] and flag in the signal. The waiver-analyst can still run on roster + standings. |
| Transactions page gated |
Ask user: "What's your FAAB remaining right now? Visible at the top of the transactions page." Accept user value; mark faab_confidence: 0.6. |
User-paste template (reuse for any Yahoo page):
"I couldn't reach {URL}. Please copy the visible table on that page (select all, paste into chat) and I'll extract the fields I need from your paste."
Parse the pasted text with the same regex/row patterns as the live page. See resources/methodology.md.
Guardrails
Never assume the roster is still what it was yesterday. Waivers clear daily and trades can fire any time. Always re-read the Yahoo team page at the start of every run, even if team-profile.md looks fresh.
FAAB remaining is derived, not displayed. Yahoo's UI sometimes shows "FAAB Balance" and sometimes doesn't. The authoritative computation is: $100 minus sum of all winning bids on the transactions page this season. Do not trust a single visible number over the ledger.
Cite every URL. The signal file's source_urls: list must contain every Yahoo page actually visited. If a page was skipped because of degradation, note it in the signal body, not silently.
Do not re-scrape downstream. Once this skill has emitted today's league-state signal, lineup-optimizer / waiver-analyst / category-strategist MUST read that signal rather than re-visit Yahoo. Re-scraping wastes tokens and risks drift.
Overwrite team-profile.md; append nowhere. This file is "current state." Preserving yesterday's roster pollutes it. The append-only log lives in tracker/decisions-log.md, not here.
Status values are normalized enums. Map Yahoo's labels (P, DTD, IL-10, IL-60, NA, SUSP) to the normalized enum: active | BN | IL | DTD | NA | SUSP. Downstream agents branch on the enum, not Yahoo's strings.
Today's opponent may be blank. Off-days, postponements, and doubleheaders all produce unusual opp_today values. Record exactly what Yahoo shows (@TEX, TEX, Off, PPD, DH1/DH2) — do not normalize away information the downstream lineup-optimizer needs.
Don't emit a signal with zero source URLs. If every page failed, write an empty-body signal with confidence: 0.0 and a prominent note to the coach: "Could not reach Yahoo — paste or retry required before any downstream agent runs."
Quick Reference
The five Yahoo URLs (from context/frameworks/data-sources.md):
Team: https://baseball.fantasysports.yahoo.com/b1/23756/5
Standings: https://baseball.fantasysports.yahoo.com/b1/23756?lhst=stand
Matchup: https://baseball.fantasysports.yahoo.com/b1/23756/matchup
Transactions: https://baseball.fantasysports.yahoo.com/b1/23756/transactions
Free agents: https://baseball.fantasysports.yahoo.com/b1/23756/players?status=A
Chrome tool order (load via ToolSearch first, then call):
1. mcp__claude-in-chrome__tabs_context_mcp (confirm active tab, auth state)
2. mcp__claude-in-chrome__navigate (go to URL)
3. mcp__claude-in-chrome__get_page_text (extract DOM text)
4. mcp__claude-in-chrome__read_page (structured read if text fails)
Roster slot order (for team-profile YAML; matches league-config.md):
C, 1B, 2B, 3B, SS, OF, OF, OF, UTIL, UTIL, SP, SP, SP, RP, RP, P, P, P, P, P, BN, BN, BN, IL, IL, IL
Status enum mapping:
| Yahoo |
Normalized |
| (blank) / P |
active |
| BN |
BN |
| DTD |
DTD |
| IL-10 / IL-60 / IL |
IL |
| NA |
NA |
| SUSP |
SUSP |
Signal frontmatter (minimum fields):
---
type: league-state
date: 2026-04-17
emitted_by: mlb-league-state-reader
variant_synthesis: false
confidence: 0.9
source_urls:
- https://baseball.fantasysports.yahoo.com/b1/23756/5
- https://baseball.fantasysports.yahoo.com/b1/23756?lhst=stand
- https://baseball.fantasysports.yahoo.com/b1/23756/matchup
- https://baseball.fantasysports.yahoo.com/b1/23756/transactions
- https://baseball.fantasysports.yahoo.com/b1/23756/players?status=A
---
Key resources:
- resources/template.md: team-profile.md output format, signal file output format, roster YAML schema, free-agents table schema
- resources/methodology.md: Yahoo navigation sequence, parsing patterns per page, FAAB reconstruction, paste parsing, degraded-mode prompts
- resources/evaluators/rubric_mlb_league_state_reader.json: 8 scoring criteria (roster completeness, FAAB accuracy, URL citation, fallback handling, etc.)
Inputs required:
- Authenticated Yahoo Fantasy session in Chrome (user's responsibility)
context/league-config.md (league ID, team ID, roster shape)
context/team-profile.md (prior state, may be stub)
Outputs produced:
- Updated
context/team-profile.md (overwrite; reflects today's state)
signals/YYYY-MM-DD-league-state.md (with frontmatter + source_urls)
- Degraded-mode prompts to user if any page fails
1---
2name: mlb-league-state-reader
3description: Parses Yahoo Fantasy Baseball league state (roster, standings, current matchup, FAAB remaining, free agents) from authenticated Yahoo team pages via Claude-in-Chrome browser automation, then grounds it against league-config.md and team-profile.md to emit a normalized league-state bundle every other agent can consume without re-scraping. Use when the coach or any downstream agent needs to read Yahoo roster, refresh team profile, pull league state, get current matchup, check FAAB remaining, list free agents, or when user mentions "what's on my roster", "who am I playing this week", "how much FAAB do I have left", or "refresh my team".
4---
5
6# MLB League State Reader
7
8## Table of Contents
9- [Example](#example)
10- [Workflow](#workflow)
11- [Degraded Mode](#degraded-mode)
12- [Guardrails](#guardrails)
13- [Quick Reference](#quick-reference)
14
15## Example
16
17**Scenario**: Morning brief run on 2026-04-17. Coach needs current roster, matchup, FAAB, and standings before launching lineup-optimizer.
18
19**Inputs read first**:
20- `yahoo-mlb/context/league-config.md` (league ID 23756, team 5, 12 teams, 5x5 cats)
21- `yahoo-mlb/context/team-profile.md` (prior known roster skeleton)
22
23**Chrome navigation sequence** (authenticated):
241. `https://baseball.fantasysports.yahoo.com/b1/23756/5` — roster with today's opponents per player
252. `https://baseball.fantasysports.yahoo.com/b1/23756?lhst=stand` — standings + category ranks
263. `https://baseball.fantasysports.yahoo.com/b1/23756/matchup` — this week's head-to-head vs Los Doyers
274. `https://baseball.fantasysports.yahoo.com/b1/23756/transactions` — FAAB spent to date → remaining
285. `https://baseball.fantasysports.yahoo.com/b1/23756/players?status=A` — top free agents (page 1)
29
30**Extracted bundle**:
31
32| Field | Value |
33|---|---|
34| Record | 8-6-1 |
35| Rank | 5 of 12 |
36| FAAB spent | $14 |
37| FAAB remaining | **$86** |
38| This week opp | Los Doyers |
39| Live matchup score | 4-3-3 (us leading R, HR, K; losing OBP, ERA, WHIP) |
40| Roster returned | 26 of 26 slots populated |
41| Free agents top-20 | captured for waiver-analyst |
42
43**Outputs written**:
44- `context/team-profile.md` — roster snapshot updated in place (slot, player, MLB team, today's opp, status)
45- `signals/2026-04-17-league-state.md` — signal file with YAML frontmatter, source_urls, confidence
46
47Every downstream agent (lineup-optimizer, waiver-analyst, category-strategist) now reads this signal file and team-profile.md rather than re-scraping Yahoo.
48
49## Workflow
50
51Copy this checklist and track progress:
52
53```
54League State Reader Progress:
55- [ ] Step 1: Read context files (league-config.md + team-profile.md)
56- [ ] Step 2: Pull Yahoo pages via Claude-in-Chrome (5 URLs)
57- [ ] Step 3: Parse roster, standings, matchup, FAAB, free agents
58- [ ] Step 4: Update team-profile.md in place
59- [ ] Step 5: Emit signal file with frontmatter + source_urls
60```
61
62**Step 1: Read context files**
63
64Load the authoritative contract and the last known state before touching Yahoo. This both verifies the league ID/URL and provides the skeleton to diff against.
65
66- [ ] Read `yahoo-mlb/context/league-config.md` — confirm league ID 23756, team 5, roster shape (C/1B/2B/3B/SS/3OF/2UTIL/3SP/2RP/5P/3BN/3IL = 26), FAAB budget $100
67- [ ] Read `yahoo-mlb/context/team-profile.md` — capture prior FAAB remaining, prior roster for diff
68- [ ] Read `yahoo-mlb/context/frameworks/signal-framework.md` — confirm signal file format
69- [ ] Read `yahoo-mlb/context/frameworks/data-sources.md` — confirm the 5 Yahoo URLs
70
71**Step 2: Pull Yahoo pages via Claude-in-Chrome**
72
73The user is already authenticated in the browser. Navigate in order; parse page text; if any step fails, jump to [Degraded Mode](#degraded-mode) for that specific URL only (do not abort the whole run). See [resources/methodology.md](resources/methodology.md#yahoo-navigation-sequence) for the exact tool-call sequence and page-parsing patterns.
74
75- [ ] Team page: `https://baseball.fantasysports.yahoo.com/b1/23756/5`
76- [ ] Standings: `https://baseball.fantasysports.yahoo.com/b1/23756?lhst=stand`
77- [ ] Matchup: `https://baseball.fantasysports.yahoo.com/b1/23756/matchup`
78- [ ] Transactions (for FAAB): `https://baseball.fantasysports.yahoo.com/b1/23756/transactions`
79- [ ] Free agents: `https://baseball.fantasysports.yahoo.com/b1/23756/players?status=A`
80
81**Step 3: Parse and normalize**
82
83Extract structured data from each page. See [resources/methodology.md](resources/methodology.md#parsing-patterns) for row-level parsing logic, and [resources/methodology.md](resources/methodology.md#faab-remaining-computation) for how to reconstruct FAAB remaining from the transactions log.
84
85- [ ] Roster: for each of 26 slots, capture `{slot, player, mlb_team, opp_today, status: active|IL|DTD|NA|BN}`
86- [ ] Standings: W-L-T record, rank, per-category rank (10 cats)
87- [ ] Matchup: opponent name, live scoreline by category (W-L-T across the 10 cats so far this week)
88- [ ] FAAB: sum all `-$N` entries from transactions history this season; remaining = $100 - total spent
89- [ ] Free agents: capture top 25 by rostered% — enough for waiver-analyst to start ranking
90
91**Step 4: Update team-profile.md in place**
92
93See [resources/template.md](resources/template.md#team-profile-output-format) for the exact output shape. Overwrite the existing file (not append); this file is meant to always reflect "as of the latest run."
94
95- [ ] Header: `## As of YYYY-MM-DD`
96- [ ] State table: record, rank, FAAB remaining, current opponent, acquisitions used, IL slots used
97- [ ] Roster snapshot: full 26-slot YAML block
98- [ ] Open questions: empty unless a page failed
99
100**Step 5: Emit signal file**
101
102Write `yahoo-mlb/signals/YYYY-MM-DD-league-state.md` with YAML frontmatter per the signal framework. Every URL navigated must appear in `source_urls`. Degraded fetches drop `confidence` to 0.5; full-failure fields drop to 0.3 and are flagged. See [resources/template.md](resources/template.md#signal-file-output-format).
103
104- [ ] Frontmatter: `type: league-state`, `date`, `emitted_by: mlb-league-state-reader`, `confidence`, `source_urls[]`
105- [ ] Body: roster table, standings table, matchup table, FAAB ledger, top-25 free agents
106- [ ] Validate via `mlb-signal-emitter` before writing (if that skill is available in this run); otherwise write directly
107
108## Degraded Mode
109
110Chrome can fail for several reasons: tab not open, session expired, Yahoo rate-limiting, 500 error, unreadable DOM. **Never abort the whole run.** Fail gracefully per-URL.
111
112**Per-URL fallback decision tree:**
113
114| Failure | Fallback |
115|---|---|
116| Navigation error / timeout | Retry once. If still failing, ask user: "Paste the contents of `{URL}` and I'll parse from that." |
117| Session expired (login page returned) | Ask user: "Please log into Yahoo in your Chrome tab, then say 'retry'." Do not attempt to re-authenticate. |
118| Page loads but parse fails (unknown layout) | Dump the first ~4000 chars of `get_page_text` into the signal file under `raw_capture:` and drop confidence to 0.4 for that field. |
119| Free-agents page gated / empty | Mark `free_agents: []` and flag in the signal. The waiver-analyst can still run on roster + standings. |
120| Transactions page gated | Ask user: "What's your FAAB remaining right now? Visible at the top of the transactions page." Accept user value; mark `faab_confidence: 0.6`. |
121
122**User-paste template** (reuse for any Yahoo page):
123
124> "I couldn't reach `{URL}`. Please copy the visible table on that page (select all, paste into chat) and I'll extract the fields I need from your paste."
125
126Parse the pasted text with the same regex/row patterns as the live page. See [resources/methodology.md](resources/methodology.md#paste-parsing).
127
128## Guardrails
129
1301. **Never assume the roster is still what it was yesterday.** Waivers clear daily and trades can fire any time. Always re-read the Yahoo team page at the start of every run, even if `team-profile.md` looks fresh.
131
1322. **FAAB remaining is derived, not displayed.** Yahoo's UI sometimes shows "FAAB Balance" and sometimes doesn't. The authoritative computation is: `$100 minus sum of all winning bids on the transactions page this season`. Do not trust a single visible number over the ledger.
133
1343. **Cite every URL.** The signal file's `source_urls:` list must contain every Yahoo page actually visited. If a page was skipped because of degradation, note it in the signal body, not silently.
135
1364. **Do not re-scrape downstream.** Once this skill has emitted today's league-state signal, lineup-optimizer / waiver-analyst / category-strategist MUST read that signal rather than re-visit Yahoo. Re-scraping wastes tokens and risks drift.
137
1385. **Overwrite team-profile.md; append nowhere.** This file is "current state." Preserving yesterday's roster pollutes it. The append-only log lives in `tracker/decisions-log.md`, not here.
139
1406. **Status values are normalized enums.** Map Yahoo's labels (`P`, `DTD`, `IL-10`, `IL-60`, `NA`, `SUSP`) to the normalized enum: `active | BN | IL | DTD | NA | SUSP`. Downstream agents branch on the enum, not Yahoo's strings.
141
1427. **Today's opponent may be blank.** Off-days, postponements, and doubleheaders all produce unusual `opp_today` values. Record exactly what Yahoo shows (`@TEX`, `TEX`, `Off`, `PPD`, `DH1/DH2`) — do not normalize away information the downstream lineup-optimizer needs.
143
1448. **Don't emit a signal with zero source URLs.** If every page failed, write an empty-body signal with `confidence: 0.0` and a prominent note to the coach: "Could not reach Yahoo — paste or retry required before any downstream agent runs."
145
146## Quick Reference
147
148**The five Yahoo URLs (from `context/frameworks/data-sources.md`):**
149
150```
151Team: https://baseball.fantasysports.yahoo.com/b1/23756/5
152Standings: https://baseball.fantasysports.yahoo.com/b1/23756?lhst=stand
153Matchup: https://baseball.fantasysports.yahoo.com/b1/23756/matchup
154Transactions: https://baseball.fantasysports.yahoo.com/b1/23756/transactions
155Free agents: https://baseball.fantasysports.yahoo.com/b1/23756/players?status=A
156```
157
158**Chrome tool order (load via `ToolSearch` first, then call):**
159
160```
1611. mcp__claude-in-chrome__tabs_context_mcp (confirm active tab, auth state)
1622. mcp__claude-in-chrome__navigate (go to URL)
1633. mcp__claude-in-chrome__get_page_text (extract DOM text)
1644. mcp__claude-in-chrome__read_page (structured read if text fails)
165```
166
167**Roster slot order (for team-profile YAML; matches `league-config.md`):**
168
169```
170C, 1B, 2B, 3B, SS, OF, OF, OF, UTIL, UTIL, SP, SP, SP, RP, RP, P, P, P, P, P, BN, BN, BN, IL, IL, IL
171```
172
173**Status enum mapping:**
174
175| Yahoo | Normalized |
176|---|---|
177| (blank) / P | `active` |
178| BN | `BN` |
179| DTD | `DTD` |
180| IL-10 / IL-60 / IL | `IL` |
181| NA | `NA` |
182| SUSP | `SUSP` |
183
184**Signal frontmatter (minimum fields):**
185
186```yaml
187---
188type: league-state
189date: 2026-04-17
190emitted_by: mlb-league-state-reader
191variant_synthesis: false
192confidence: 0.9
193source_urls:
194 - https://baseball.fantasysports.yahoo.com/b1/23756/5
195 - https://baseball.fantasysports.yahoo.com/b1/23756?lhst=stand
196 - https://baseball.fantasysports.yahoo.com/b1/23756/matchup
197 - https://baseball.fantasysports.yahoo.com/b1/23756/transactions
198 - https://baseball.fantasysports.yahoo.com/b1/23756/players?status=A
199---
200```
201
202**Key resources:**
203
204- **[resources/template.md](resources/template.md)**: team-profile.md output format, signal file output format, roster YAML schema, free-agents table schema
205- **[resources/methodology.md](resources/methodology.md)**: Yahoo navigation sequence, parsing patterns per page, FAAB reconstruction, paste parsing, degraded-mode prompts
206- **[resources/evaluators/rubric_mlb_league_state_reader.json](resources/evaluators/rubric_mlb_league_state_reader.json)**: 8 scoring criteria (roster completeness, FAAB accuracy, URL citation, fallback handling, etc.)
207
208**Inputs required:**
209
210- Authenticated Yahoo Fantasy session in Chrome (user's responsibility)
211- `context/league-config.md` (league ID, team ID, roster shape)
212- `context/team-profile.md` (prior state, may be stub)
213
214**Outputs produced:**
215
216- Updated `context/team-profile.md` (overwrite; reflects today's state)
217- `signals/YYYY-MM-DD-league-state.md` (with frontmatter + source_urls)
218- Degraded-mode prompts to user if any page fails