Skip to main content
Glama
justfeltlikerunning

Sleeper Fantasy MCP

get_nfl_state

Retrieve current NFL season status including week number, playoff status, and team bye weeks for fantasy football management and scheduling decisions.

Instructions

Get current NFL season state including week, playoffs, and team bye weeks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeByeWeeksNoInclude team bye weeks information (default: true)
seasonNoSeason year (defaults to current season)

Implementation Reference

  • The execute method implements the core logic: fetches current NFL state from API, processes season info, bye weeks (if requested), computes schedules, timestamps, fantasy implications, and returns structured JSON.
    async execute(args: any) {
      const includeByeWeeks = args.includeByeWeeks !== false; // Default to true
      const season = args.season || new Date().getFullYear().toString();
    
      try {
        // Fetch NFL state
        const stateResponse = await fetch(`${config.api.baseUrl}/state/nfl`);
        if (!stateResponse.ok) {
          throw new Error('Failed to fetch NFL state');
        }
        
        const nflState = await stateResponse.json();
    
        // Parse the NFL state data
        const result: any = {
          season: season,
          currentWeek: nflState.week,
          seasonType: nflState.season_type, // 'regular', 'post', 'pre', 'off'
          status: {
            isRegularSeason: nflState.season_type === 'regular',
            isPostseason: nflState.season_type === 'post',
            isPreseason: nflState.season_type === 'pre',
            isOffseason: nflState.season_type === 'off'
          },
          schedule: {
            regularSeasonWeeks: 18,
            playoffWeekStart: 19,
            currentSeasonWeek: nflState.week,
            weeksRemaining: nflState.season_type === 'regular' ? Math.max(0, 18 - nflState.week) : 0
          },
          timestamps: {
            seasonStart: this.getSeasonStartDate(season),
            currentWeekStart: this.getWeekStartDate(nflState.week, season),
            nextWeekStart: this.getWeekStartDate(nflState.week + 1, season)
          }
        };
    
        // Add bye weeks information if requested
        if (includeByeWeeks) {
          const byeWeeks = this.getByeWeekSchedule(season);
          const currentByeTeams = byeWeeks[nflState.week] || [];
          const upcomingByes = this.getUpcomingByes(byeWeeks, nflState.week);
    
          result.byeWeeks = {
            currentWeek: {
              week: nflState.week,
              teamsOnBye: currentByeTeams,
              teamCount: currentByeTeams.length
            },
            upcoming: upcomingByes,
            fullSchedule: byeWeeks,
            summary: {
              totalByeWeeks: Object.keys(byeWeeks).length,
              weeksWithByes: Object.keys(byeWeeks).map(Number).sort((a, b) => a - b),
              remainingByeWeeks: Object.keys(byeWeeks)
                .map(Number)
                .filter(week => week > nflState.week)
                .sort((a, b) => a - b)
            }
          };
        }
    
        // Add contextual information
        result.context = {
          isFantasyRelevant: nflState.season_type === 'regular' || nflState.season_type === 'post',
          weekDescription: this.getWeekDescription(nflState.week, nflState.season_type),
          nextWeekPreview: this.getNextWeekPreview(nflState.week, nflState.season_type, includeByeWeeks ? this.getByeWeekSchedule(season) : {}),
          fantasyImplications: this.getFantasyImplications(nflState.week, nflState.season_type)
        };
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new Error(`Failed to get NFL state: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Defines the input schema for the tool, including optional boolean for bye weeks and season string with regex validation.
    inputSchema = {
      type: "object",
      properties: {
        includeByeWeeks: {
          type: "boolean",
          description: "Include team bye weeks information (default: true)",
          default: true
        },
        season: {
          type: "string",
          description: "Season year (defaults to current season)",
          pattern: "^[0-9]{4}$"
        }
      }
    };
  • src/index.ts:92-93 (registration)
    In the CallToolRequestSchema handler switch statement, dispatches calls to 'get_nfl_state' to the stateScheduleTool instance's execute method.
    case "get_nfl_state":
      return await stateScheduleTool.execute(args);
  • src/index.ts:48-63 (registration)
    Registers the stateScheduleTool instance in the list of tools returned by ListToolsRequestSchema.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        leagueTool,
        rosterTool,
        matchupTool,
        playerTool,
        projectionsTool,
        matchupProjectionsTool,
        lineupOptimizerTool,
        trendingTool,
        historicalScoresTool,
        playerNewsTool,
        transactionsTool,
        stateScheduleTool,
      ],
    }));
  • Helper method providing hardcoded 2024 NFL bye week schedule used when includeByeWeeks is true.
    private getByeWeekSchedule(season: string): Record<number, string[]> {
      // 2024/2025 NFL bye week schedule (weeks 5-14 typically)
      // This would ideally come from an API, but hardcoded for now
      const byeSchedule2024: Record<number, string[]> = {
        5: ['GB', 'LV'],
        6: ['LAR', 'MIA', 'MIN', 'PHI'],
        7: ['BUF', 'NO', 'NYJ', 'TEN'],
        8: ['SF'],
        9: ['ATL', 'CAR', 'CHI', 'DAL', 'DEN', 'HOU', 'NE', 'NYG', 'WAS'],
        10: ['ARI', 'BAL', 'CLE', 'LAC', 'PIT', 'SEA'],
        11: ['CIN', 'DET', 'IND', 'JAX', 'KC', 'TB'],
        12: [],
        13: [],
        14: []
      };
    
      // For other seasons, we'd need to fetch from an API or database
      // For now, return the 2024 schedule
      return byeSchedule2024;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool retrieves data (implying read-only), but doesn't mention authentication needs, rate limits, response format, or whether it's real-time vs cached data. This leaves significant behavioral gaps for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose with specific data points. Every word earns its place with zero redundancy or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description provides basic purpose but lacks details on return values, error conditions, or behavioral constraints. It's minimally adequate for a simple read operation but doesn't fully compensate for missing structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are fully documented in the schema. The description adds no additional parameter semantics beyond implying season state retrieval, which aligns with schema details. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('current NFL season state'), listing key data points like week, playoffs, and bye weeks. It distinguishes itself from siblings by focusing on season-wide state rather than player, matchup, or transaction details, though it doesn't explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving current season state, but provides no explicit guidance on when to use this tool versus alternatives like get_historical_scores or get_league_info. It lacks clear exclusions or prerequisites, leaving usage context to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/justfeltlikerunning/sleeper-fantasy-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server