Skip to main content
Glama
argotdev

NHL MCP Server

by argotdev

compare_seasons

Analyze NHL team or player statistics across different seasons to identify trends and performance changes.

Instructions

Compare team or player statistics across multiple NHL seasons.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
teamAbbrevNoTeam abbreviation to compare (optional)
seasonsYesArray of seasons to compare in format YYYYYYYY (e.g., ["20232024", "20242025"])

Implementation Reference

  • src/index.ts:192-212 (registration)
    Tool registration in the TOOLS array, including name, description, and input schema.
    {
      name: 'compare_seasons',
      description: 'Compare team or player statistics across multiple NHL seasons.',
      inputSchema: {
        type: 'object',
        properties: {
          teamAbbrev: {
            type: 'string',
            description: 'Team abbreviation to compare (optional)',
          },
          seasons: {
            type: 'array',
            items: {
              type: 'string',
            },
            description: 'Array of seasons to compare in format YYYYYYYY (e.g., ["20232024", "20242025"])',
          },
        },
        required: ['seasons'],
      },
    },
  • The handler function that executes the compare_seasons tool, fetching and comparing standings data across specified seasons for a team or league-wide.
    async function compareSeasons(seasons: string[], teamAbbrev?: string): Promise<string> {
      try {
        if (!teamAbbrev) {
          // Compare league-wide stats
          const results: string[] = [];
    
          for (const season of seasons) {
            const standings = await client.getStandingsBySeason(season);
            const teams = standings.standings || [];
    
            const totalGoals = teams.reduce((sum, t) => sum + t.goalFor, 0);
            const totalGames = teams.reduce((sum, t) => sum + t.gamesPlayed, 0);
    
            results.push(
              `Season ${client.formatSeason(season)}:\n` +
                `  Total teams: ${teams.length}\n` +
                `  Total goals: ${totalGoals}\n` +
                `  Avg goals/game: ${(totalGoals / totalGames).toFixed(2)}`
            );
          }
    
          return `Season Comparison:\n\n${results.join('\n\n')}`;
        } else {
          // Compare specific team across seasons
          const results: string[] = [];
    
          for (const season of seasons) {
            const standings = await client.getStandingsBySeason(season);
            const team = (standings.standings || []).find(
              (t) => t.teamAbbrev.default === teamAbbrev
            );
    
            if (team) {
              results.push(
                `${client.formatSeason(season)} - ${teamAbbrev}:\n` +
                  `  Record: ${team.wins}-${team.losses}-${team.otLosses}\n` +
                  `  Points: ${team.points}\n` +
                  `  Goals For: ${team.goalFor}\n` +
                  `  Goals Against: ${team.goalAgainst}\n` +
                  `  Goal Diff: ${team.goalDifferential}`
              );
            } else {
              results.push(`${client.formatSeason(season)} - ${teamAbbrev}: No data found`);
            }
          }
    
          return `Season Comparison for ${teamAbbrev}:\n\n${results.join('\n\n')}`;
        }
      } catch (error: any) {
        return `Error comparing seasons: ${error.message}`;
      }
    }
  • src/index.ts:593-601 (registration)
    Registration in the switch statement of the CallToolRequestSchema handler, dispatching to the compareSeasons function.
    case 'compare_seasons': {
      const comparison = await compareSeasons(
        parameters.seasons as string[],
        parameters.teamAbbrev as string | undefined
      );
      return {
        content: [{ type: 'text', text: comparison }],
      };
    }
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 the tool compares statistics but does not describe what statistics are returned, how data is formatted, whether it's aggregated or detailed, or any limitations like rate limits or data freshness. For a tool with no annotations, this is a significant gap in transparency.

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 purpose without any wasted words. It is front-loaded with the core functionality, making it easy to parse and understand quickly. This exemplifies good conciseness and structure.

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 complexity of comparing statistics across seasons, the lack of annotations, and no output schema, the description is incomplete. It does not explain what kind of statistics are compared, the format of the output, or any behavioral traits like data sources or limitations. For a tool with no structured support, the description should provide more context to be fully helpful.

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 input schema has 100% description coverage, clearly documenting both parameters. The description adds no additional semantic information beyond what the schema provides, such as explaining the meaning of 'teamAbbrev' or 'seasons' in context. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, but the description does not compensate with extra insights.

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: 'Compare team or player statistics across multiple NHL seasons.' It specifies the verb ('compare'), resource ('team or player statistics'), and scope ('across multiple NHL seasons'), making it easy to understand. However, it does not explicitly differentiate from sibling tools like 'compare_teams' or 'get_team_stats', which might offer overlapping functionality, so it falls short of 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. It does not mention sibling tools such as 'compare_teams' or 'get_team_stats', nor does it specify prerequisites, exclusions, or contexts for usage. This lack of comparative guidance leaves the agent without clear direction on tool selection.

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/argotdev/nhl-mcp-ts'

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