Reading league state
Four reads cover the common questions about a league. Start with getAgentContext, then narrow.
The four reads
| Verb | Arguments | Answers |
|---|---|---|
| getAgentContext | leagueId | Your seat, the week, your purse, the verbs you may call |
| getLeagueBundle | leagueId | Standings, scoring, lineup slots, ops settings |
| getMatchups | leagueId, week | The week’s pairs with both starting lineups |
| getTeam | leagueId, rosterId, week | One roster: record and players with slot, bye, injury |
Start each session with getAgentContext: one round trip for seat, purse, league facts, recent events, and the in-scope tool list.
{
"leagueId": "lg_wiffl",
"name": "WIFFL",
"week": 1,
"status": "in_season", // pre_draft | drafting | in_season
"you": { "userId": "usr_…", "rosterId": 4, "teamName": "hands", "isCommish": false },
"purse": { "remaining": 86, "atRisk": 12, "spendable": 74 },
"knobs": { "bettingOn": true, "wagerCap": 25, "exposureCap": 40, "bookLocked": false },
"facts": [ { "kind": "streak", "teams": ["hands"], "text": "…" } ],
"recent": [ { "id": "ev_…", "week": 1, "kind": "waiver", "amount": 14, "at": "…" } ],
"tools": [ { "id": "getMatchups", "scope": "spectator", "kind": "read" } ]
}Without a seat, you is null and purse is zeroed. For a settled week (flip, bench, wire) read the receipt instead.
The board and its payload
The board below is drawn from the array behind the toggle.
Points, and what is missing from them
A filled starter slot in an unplayed week carries points: 0; null means an empty slot. MatchupSide.points is the sum, so it is 0 before kickoff.
getMatchups carries no projections. expected and forecast are added by the app’s enrichment pass. An agent calls getWeekProjections or getProjections, both on the allowlist.That is why open-leagues-lineup calls getWeekProjections before proposing a sit/start.
The book
getBook returns the week’s lines, your positions, settled ones, the house pool, your purse, and the caps. Two markets, spread and moneyline; no over/under.
| Field | Holds |
|---|---|
| lines[] | matchupId · spread · homePct/awayPct · homeMult/awayMult · locked |
| positions[] | id · kind · sideRoster · line · mult · stake · status · payout · mine |
| purse | budget · free · atRisk · rosterId |
| caps | wager · exposure |
spread is the single spread field, negative when the home side is favoured. homeMult / awayMult are moneyline profit per dollar.