Use only for fantasy sports questions that need the user's connected league data; do not call for generic coding, scraping, weather, travel, betting, or non-fantasy sports questions. Call this exactly once at the start of each chat before any other Flaim tool. Returns the user's full league landscape: allLeagues (all active leagues), defaultLeagues (per-sport defaults), and defaultLeague (populated only when a single league exists or defaultSport matches). For vague singular prompts, use defaultLeague when present; otherwise use the relevant sport entry in defaultLeagues. For explicit plural or comparative prompts (each, all, compare, across leagues/platforms), enumerate every matching league in allLeagues and call the target tool once per league. In normal chat flows, do not skip this first step. After this, strongly consider calling get_league_info for the target league. season_year always represents the start year of the season. Read-only. If this call errors, do not repeat it unchanged.
No parameters.
refresh_leagues
Refresh connected fantasy leagues by asking Flaim to rediscover leagues through connected ESPN, Yahoo, and Sleeper accounts. Use only when the user explicitly asks to refresh or after the user presses the widget refresh button. This is non-destructive and idempotent: it may add/update discovered league records but does not make roster moves, trades, drops, or lineup changes. If this call succeeds, call get_user_session again to show the updated league list. If this call errors, do not repeat it unchanged.
Parameters (1)
platformsarray
Optional platforms to refresh. Omit to refresh every connected platform.
get_ancient_history
Use this only after get_user_session, and only when the user is clearly asking about a non-current season or an inactive league. This is the historical branch: it returns past seasons and historical leagues outside the current season view. Use for last season, older seasons, inactive leagues, or historical performance. Read-only. If this call errors, do not repeat it unchanged.
Parameters (1)
platformstring
Optional: filter to specific platform
get_league_info
Strongly encouraged as the second call after get_user_session for the specified league. This provides the baseline league context for analysis: league name, settings, scoring type, roster configuration, and team/owner context, plus schedule or season-window metadata when the platform provides it. Use it liberally before standings, matchups, roster, free-agent, player, or transaction analysis so team names are resolved and the model has league-type, scoring, and roster context. When fanning out across multiple leagues, call this once per league. The exact team fields vary by platform but all include ownerName. Use values from get_user_session. Read-only. If this call errors, do not repeat it unchanged. Current date is 2026-07-06.
Parameters (4)
platformstringrequired
Fantasy platform (e.g., "espn", "yahoo", "sleeper")
sportstringrequired
Sport type (e.g., "football", "baseball")
league_idstringrequired
League ID (get from get_user_session)
season_yearnumberrequired
Season start year (e.g., 2025 for MLB 2025, 2024 for NBA 2024-25)
get_standings
Get season standings and outcome snapshot; includes verified season-outcome fields when available. Returns team records, rankings, and points summaries. The rank field is a standings sort position (1 = best): on ESPN and Sleeper it is computed by Flaim from win percentage; on Yahoo it is passed through from Yahoo's own standings API. It is NOT a verified postseason finish. For verified postseason outcome, use finalRank and championshipWon instead. Also returns seasonPhase (regular_season/playoffs_in_progress/season_complete), seasonComplete, and per-team outcome fields: finalRank, championshipWon, playoffOutcome, outcomeConfidence, madePlayoffs, playoffSeed. Outcome fields are null when not verifiable — do not infer championship from rank or team name. Note: playoffOutcome returns 'in_progress' on Sleeper for teams in active playoffs; ESPN and Yahoo return null for that state. ESPN may also include projected-rank fields. Best used after get_user_session and after get_league_info for the specified league so team names and league context are already established. For multi-league comparisons, call once per league. For historical finish questions, call get_ancient_history first to discover seasons, then call this tool per season for verified outcomes. Read-only. If this call errors, do not repeat it unchanged. Current date is 2026-07-06.
Parameters (4)
platformstringrequired
Fantasy platform (e.g., "espn", "yahoo", "sleeper")
sportstringrequired
Sport type (e.g., "football", "baseball")
league_idstringrequired
League ID (get from get_user_session)
season_yearnumberrequired
Season start year (e.g., 2025 for MLB 2025, 2024 for NBA 2024-25)
get_matchups
Get matchups/scoreboard for a specific week or the current week. Best used after get_user_session and after get_league_info for the specified league so the model already knows the league's team names, owner/team mapping, and league context before interpreting the matchup. For multi-league comparisons, call once per league. Read-only. If this call errors, do not repeat it unchanged. Current date is 2026-07-06.
Parameters (5)
platformstringrequired
Fantasy platform (e.g., "espn", "yahoo", "sleeper")
sportstringrequired
Sport type (e.g., "football", "baseball")
league_idstringrequired
League ID (get from get_user_session)
season_yearnumberrequired
Season start year (e.g., 2025 for MLB 2025, 2024 for NBA 2024-25)
weekinteger
Week number (optional, must be ≥ 1, defaults to current week)
get_roster
Get roster details for a specific team. Exact payload varies by platform: ESPN and Yahoo return player entries with lineup/position context, while Sleeper returns starters, bench, reserve, and record metadata for the selected roster. Best used after get_user_session and after get_league_info for the specified league so the model already knows the league's team names, owner/team mapping, league settings, and roster context before interpreting this roster. Requires authentication except on Sleeper's public API. Read-only. If this call errors, do not repeat it unchanged. Current date is 2026-07-06.
Parameters (6)
platformstringrequired
Fantasy platform (e.g., "espn", "yahoo", "sleeper")
sportstringrequired
Sport type (e.g., "football", "baseball")
league_idstringrequired
League ID (get from get_user_session)
season_yearnumberrequired
Season start year (e.g., 2025 for MLB 2025, 2024 for NBA 2024-25)
team_idstring
Team ID for the target roster. Recommended for all platforms; required on Yahoo. If omitted, platform behavior varies and may not resolve to the user's team.
weekinteger
Week number (optional, must be ≥ 1, defaults to current week)
get_free_agents
Get currently available players for the specified league, optionally filtered by position. Exact payload varies by platform: ESPN and Yahoo include ownership percentages and sort by ownership, while Sleeper returns available-player identities from the public player index without ownership percentages. Best used after get_user_session and usually after get_league_info for the specified league so team names, owner/team mapping, scoring context, and roster-slot context are already established before giving pickup advice. For multi-league comparisons, call once per league. Use this for player availability only. Do not use percentOwned or market ownership to infer who owns a player in the user's league; for ownership questions, use get_league_info (returns teams with ownerName) and get_roster. Requires authentication on ESPN and Yahoo; Sleeper uses the public API. Use values from get_user_session. Read-only. If this call errors, do not repeat it unchanged. Current date is 2026-07-06.
Parameters (6)
platformstringrequired
Fantasy platform — "espn", "yahoo", or "sleeper"
sportstringrequired
Sport type (e.g., "football", "baseball")
league_idstringrequired
League ID (get from get_user_session)
season_yearnumberrequired
Season start year (e.g., 2025 for MLB 2025, 2024 for NBA 2024-25)
positionstring
Filter by position (e.g., "QB", "RB", "SP", "C"). Default: ALL
countnumber
Maximum number of players to return (default: 25, max: 100)
get_players
Search for player identity by name. Always returns identity fields, but ownership context varies by platform. ESPN and Yahoo return market/global ownership and can also populate league ownership fields when credentials and league context are available. Sleeper returns identity plus ownership_scope="unavailable" with market_percent_owned=null. Best used after get_user_session and often after get_league_info when the user cares about league-specific ownership or team-name resolution. League ownership fields: league_status ("ROSTERED" = on a team, "FREE_AGENT" = available, null = unavailable), league_team_name (fantasy team name if rostered), league_owner_name (team owner if rostered). When those league fields are absent, null, or unavailable, fall back to get_league_info + get_roster to verify manually. Use values from get_user_session. Read-only. If this call errors, do not repeat it unchanged. Current date is 2026-07-06.
Parameters (7)
querystringrequired
Player name search string (minimum 2 characters)
platformstringrequired
Fantasy platform (e.g., "espn", "yahoo", "sleeper")
sportstringrequired
Sport type (e.g., "football", "baseball")
league_idstringrequired
League ID (get from get_user_session)
season_yearnumberrequired
Season start year (e.g., 2025 for MLB 2025, 2024 for NBA 2024-25)
positionstring
Filter by position (e.g., "QB", "RB", "SP", "C"). Default: ALL
countnumber
Maximum number of players to return (default: 10, max: 25)
get_transactions
Get recent league transactions including adds, drops, waivers, and trades. Best used after get_user_session and usually after get_league_info so the model already knows the league's team names and owner/team mapping before summarizing activity. Each normalized transaction includes a date field (YYYY-MM-DD), type, status, week, and optional team_ids. When presenting results, organize by time period (today, yesterday, this week, older) AND by team within each period so the user can see both when moves happened and what each team did. Week handling is platform-specific: ESPN/Sleeper use week windows (default current + previous week), while Yahoo uses a recent 14-day timestamp window and ignores explicit week. Type support is also platform-specific: Sleeper supports add/drop/trade/waiver; Yahoo supports add/drop/trade plus pending waiver/pending_trade views for the authenticated user's own items; ESPN also supports failed_bid and trade lifecycle types (trade_proposal, trade_decline, trade_veto, trade_uphold). ESPN uses mTransactions2 for structured transaction data, and accepted trade player details are supplemented from the activity feed. ESPN responses include a "teams" map (team ID → display name) to resolve the numeric team_ids on each transaction, while Yahoo and Sleeper generally rely on get_league_info for team-name resolution. Use values from get_user_session. Read-only. If this call errors, do not repeat it unchanged. Current date is 2026-07-06.
Parameters (7)
platformstringrequired
Fantasy platform (e.g., "espn", "yahoo", "sleeper")
sportstringrequired
Sport type (e.g., "football", "baseball")
league_idstringrequired
League ID (get from get_user_session)
season_yearnumberrequired
Season start year (e.g., 2025 for MLB 2025, 2024 for NBA 2024-25)
weekinteger
Week/scoring-period number (optional, 0 = preseason). ESPN/Sleeper support explicit week; Yahoo ignores week and uses a recent 14-day timestamp window
typestring
Optional transaction type filter. Platform support varies: Sleeper supports add/drop/trade/waiver; Yahoo supports add/drop/trade plus waiver/pending_trade for the authenticated user's own pending items; ESPN also supports trade_proposal/trade_decline/trade_veto/trade_uphold/failed_bid.
countnumber
Maximum transactions to return (default: 25, max: 100)
Connect your ESPN, Yahoo, and Sleeper leagues, then use Flaim Fantasy in ChatGPT for read-only analysis grounded in your real league. The same MCP service also supports optional manual MCP clients like Claude, Perplexity, and Gemini CLI where their MCP capabilities allow.
Read-only by design. No trades, no drops, no roster changes — just advice.
How It Works
The Flaim skill teaches your AI assistant how to behave like a fantasy analyst — which data to pull, how to interpret it, and how to turn it into useful advice. The MCP tools feed it your actual league data. Together, they give a general-purpose AI enough structure to answer like it knows your specific league.
Connect your platforms — ESPN via Chrome extension, Yahoo via OAuth, Sleeper by username
Leagues discovered — Flaim finds supported leagues where possible; some private leagues or historical seasons may need manual follow-up
Pick a default league for AI conversations
Use Flaim in AI — open Flaim Fantasy in ChatGPT, or add the MCP URL in an optional manual MCP client such as Claude, Perplexity, or Gemini CLI
Optional: install the skill — recommended for agent-skill tools; copy .agents/skills/flaim-fantasy/ into your project or home directory (see The Skill below)
Ask questions — "Who should I start this week?", "What's on the waiver wire?", etc.
The Skill
The Flaim skill teaches your AI assistant how to behave like a fantasy analyst — when to use which tools, how to interpret league data, and how to turn that context into useful advice.
Install for Claude Code (or any Agent Skills-compatible tool):
Place the skill in your project's .agents/skills/ directory (cross-platform convention) or in ~/.agents/skills/ for global use:
bash
# Clone or copy the skill directorycp -r flaim/.agents/skills/flaim-fantasy ~/.agents/skills/flaim-fantasy
The AI will detect and activate the skill automatically when you ask fantasy questions.
MCP Tools
Tool
What it does
get_user_session
Your leagues across all platforms
get_ancient_history
Past seasons and historical leagues outside the current season
get_league_info
Baseline league context: settings, scoring, roster config, teams/owners
get_roster
Team roster with player stats
get_matchups
Weekly matchups and scores
get_standings
League standings and rankings
get_free_agents
Available players; ESPN/Yahoo include ownership percentages, Sleeper returns identities only
get_players
Player lookup; ESPN and Yahoo can add league ownership, Sleeper ownership is unavailable
get_transactions
Recent adds, drops, waivers, and trades
All tools connect through a single MCP endpoint: https://api.flaim.app/mcp
Solo indie project — built with care, maintained for the long term. No VC funding, no growth pressure, just a useful tool for fantasy sports fans who use AI.
Development
bash
git clone https://github.com/jdguggs10/flaim.git
cd flaim
corepack pnpm install
cp web/.env.example web/.env.local # add keys
corepack pnpm run dev
Root, web, and workers use pnpm via Corepack. The Chrome extension is intentionally npm-isolated under extension/ with its own lockfile and release flow.