Skip to main content
Glama
justfeltlikerunning

Sleeper Fantasy MCP

get_league_info

Retrieve league settings and information from Sleeper Fantasy Football for ROAD_TO_GLORY or DYNASTY leagues to support fantasy football management decisions.

Instructions

Get league information and settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
leagueNoLeague name (ROAD_TO_GLORY or DYNASTY), defaults to configured default

Implementation Reference

  • The main handler function that fetches league settings and user list from Sleeper API using the provided league config, processes the data, and returns a formatted JSON response.
    async execute(args: any) {
      const leagueConfig = getLeagueConfig(args.league);
      
      if (!leagueConfig) {
        throw new Error(`League configuration not found for: ${args.league}`);
      }
    
      try {
        const [leagueResponse, usersResponse] = await Promise.all([
          fetch(`${config.api.baseUrl}/league/${leagueConfig.id}`),
          fetch(`${config.api.baseUrl}/league/${leagueConfig.id}/users`)
        ]);
    
        if (!leagueResponse.ok || !usersResponse.ok) {
          throw new Error('Failed to fetch league data');
        }
    
        const league: SleeperLeague = await leagueResponse.json();
        const users: SleeperUser[] = await usersResponse.json();
    
        const result = {
          league: {
            name: league.name,
            season: league.season,
            sport: league.sport,
            status: league.status,
            totalRosters: league.total_rosters,
            playoffWeekStart: league.settings.playoff_week_start,
            playoffTeams: league.settings.playoff_teams,
            waiverBudget: league.settings.waiver_budget
          },
          users: users.map(user => ({
            userId: user.user_id,
            username: user.username,
            displayName: user.display_name
          })),
          yourTeam: leagueConfig.teamName,
          leagueId: leagueConfig.id
        };
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        throw new Error(`Failed to get league info: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Tool metadata including name, description, and input schema defining optional 'league' parameter.
    name = "get_league_info";
    description = "Get league information and settings";
    inputSchema = {
      type: "object",
      properties: {
        league: {
          type: "string",
          description: "League name (ROAD_TO_GLORY or DYNASTY), defaults to configured default",
          enum: ["ROAD_TO_GLORY", "DYNASTY"]
        }
      }
    };
  • src/index.ts:70-71 (registration)
    Registers the tool handler by dispatching 'get_league_info' calls to the LeagueTool's execute method in the MCP CallToolRequest handler.
    case "get_league_info":
      return await leagueTool.execute(args);
  • src/index.ts:49-62 (registration)
    Registers the LeagueTool instance (leagueTool) in the list of available tools returned by the MCP ListToolsRequest handler.
    tools: [
      leagueTool,
      rosterTool,
      matchupTool,
      playerTool,
      projectionsTool,
      matchupProjectionsTool,
      lineupOptimizerTool,
      trendingTool,
      historicalScoresTool,
      playerNewsTool,
      transactionsTool,
      stateScheduleTool,
    ],
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it's a read operation ('Get'), but doesn't mention any behavioral traits such as authentication requirements, rate limits, error conditions, or what format the information is returned in. This leaves significant gaps for an agent to understand how to use it effectively.

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, clear sentence with no wasted words. It's front-loaded with the core purpose, making it highly efficient and easy to parse. Every word earns its place by directly contributing to understanding the tool's function.

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

Completeness2/5

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

Given the lack of annotations and no output schema, the description is incomplete for a tool that retrieves data. It doesn't specify what 'information and settings' includes, how results are structured, or any behavioral context like error handling. For a read operation with no structured output documentation, this leaves too many unknowns for reliable use.

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?

The schema description coverage is 100%, with the parameter 'league' fully documented in the schema including its type, description, enum values, and default behavior. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline score of 3 for adequate coverage without extra value.

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 verb ('Get') and resource ('league information and settings'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its siblings like 'get_league_transactions' or 'get_historical_scores', which also retrieve league-related data but for different aspects.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_league_transactions' for transaction data and 'get_historical_scores' for past scores, there's no indication of when this tool is appropriate or what specific 'information and settings' it covers compared to others.

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