Skip to main content
Glama
opgginc

opgg-esports

Official
by opgginc

get-lol-matches

Retrieve upcoming League of Legends match schedules from OP.GG Esports to access structured tournament information and enhance AI capabilities with real-time esports data.

Instructions

Get upcoming LoL match schedules from OP.GG Esports

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Inline handler for the 'get-lol-matches' MCP tool. Fetches upcoming LoL matches from OP.GG Esports GraphQL API using helper function, formats into MatchInfo objects, generates a formatted text response with match details and links, handles errors gracefully.
    server.tool('get-lol-matches', 'Get upcoming LoL match schedules from OP.GG Esports', async () => {
      try {
        // Fetch match schedules
        const matches = await fetchUpcomingMatches();
    
        // Format results
        const formattedMatches = matches.map((match: any): MatchInfo => {
          const league = match.tournament?.serie?.league || {};
          return {
            id: match.id,
            name: match.name,
            status: match.status?.toUpperCase(),
            awayScore: match.awayScore,
            homeScore: match.homeScore,
            scheduledAt: match.scheduledAt,
            numberOfGames: match.numberOfGames,
            league: league.shortName || 'Unknown',
          };
        });
    
        return {
          content: [
            {
              type: 'text',
              text: `Upcoming match schedules:\n\n${formattedMatches
                .map(
                  (match: MatchInfo) =>
                    `Match: ${match.name}\nLeague: ${match.league}\nStatus: ${match.status}\nScore: ${match.homeScore} - ${match.awayScore}\nScheduled at: ${new Date(match.scheduledAt).toLocaleString()}\nDetails: https://esports.op.gg/matches/${match.id}\n---`
                )
                .join('\n')}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error fetching match schedules: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
    });
  • TypeScript interface defining the structure of formatted match information used within the tool handler for type safety.
    interface MatchInfo {
      id: number;
      name: string;
      status: string;
      homeScore: number;
      awayScore: number;
      scheduledAt: string | number | Date;
      league: string;
      numberOfGames?: number;
    }
  • Helper utility function that performs the HTTP POST request to OP.GG's GraphQL endpoint to retrieve raw upcoming matches data, with error handling.
    async function fetchUpcomingMatches() {
      try {
        const response = await fetch(GRAPHQL_ENDPOINT, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
            'User-Agent': 'MCP',
          },
          body: JSON.stringify({
            query: UPCOMING_MATCHES_QUERY,
          }),
        });
    
        if (!response.ok) {
          throw new Error(`API request failed: ${response.status} ${response.statusText}`);
        }
    
        const data = (await response.json()) as any;
    
        if (data.errors) {
          throw new Error(`GraphQL error: ${JSON.stringify(data.errors)}`);
        }
    
        return data.data.upcomingMatches;
      } catch (error) {
        console.error('Error calling OP.GG Esports API:', error);
        throw error;
      }
    }
  • GraphQL query constant used by the fetch helper to retrieve specific fields for upcoming LoL matches including scores, schedule, league info.
    const UPCOMING_MATCHES_QUERY = `
      query MCPListUpcomingMatches {
        upcomingMatches {
          id
          name
          status
          awayScore
          homeScore
          scheduledAt
          numberOfGames
          tournament {
            serie {
              league {
                shortName
              }
            }
          }
        }
      }
    `;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions retrieving data ('Get') but lacks details on rate limits, authentication needs, error handling, or response format. This leaves significant gaps in understanding how the tool behaves operationally.

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 directly states the tool's function without any redundant or unnecessary information. It is perfectly front-loaded and wastes no words, making it highly concise and well-structured.

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?

For a zero-parameter tool with no output schema, the description adequately covers the basic purpose. However, it lacks details on behavioral aspects like data freshness, pagination, or error cases, which would be helpful given the absence of annotations and output schema.

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

Parameters4/5

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

The tool has zero parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing instead on the tool's purpose, which aligns well with the empty input schema.

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 action ('Get') and resource ('upcoming LoL match schedules from OP.GG Esports'), providing a specific purpose. It distinguishes the tool by specifying the data source (OP.GG Esports) and content type (match schedules). However, without sibling tools, full differentiation isn't demonstrated, preventing a perfect score.

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, prerequisites, or contextual constraints. It merely states what the tool does without indicating appropriate scenarios or limitations, leaving usage entirely implicit.

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/opgginc/esports-mcp'

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