Skip to main content
Glama
argotdev

NHL MCP Server

by argotdev

get_team_streak

Retrieve the current winning or losing streak for an NHL team by providing its abbreviation, such as TOR or NYR, based on recent game results.

Instructions

Get current winning or losing streak for an NHL team based on recent game results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
teamAbbrevYesTeam abbreviation (e.g., TOR, NYR)

Implementation Reference

  • Core handler function that fetches the team's schedule, identifies completed games, determines the current streak (win/loss) by checking recent game outcomes, and formats the result with recent game summaries.
    async function analyzeStreak(teamAbbrev: string): Promise<string> {
      try {
        const schedule = await client.getTeamSchedule(teamAbbrev);
    
        if (!schedule.games || schedule.games.length === 0) {
          return `No games found for ${teamAbbrev}`;
        }
    
        // Get completed games sorted by date
        const completedGames = schedule.games
          .filter((g: any) => g.gameState === 'OFF' || g.gameState === 'FINAL')
          .sort((a: any, b: any) => new Date(b.gameDate).getTime() - new Date(a.gameDate).getTime());
    
        if (completedGames.length === 0) {
          return `No completed games found for ${teamAbbrev} this season`;
        }
    
        let streakCount = 0;
        let streakType = '';
        const recentResults: string[] = [];
    
        for (const game of completedGames) {
          const isHome = game.homeTeam.abbrev === teamAbbrev;
          const teamScore = isHome ? game.homeTeam.score : game.awayTeam.score;
          const oppScore = isHome ? game.awayTeam.score : game.homeTeam.score;
          const oppTeam = isHome ? game.awayTeam.abbrev : game.homeTeam.abbrev;
    
          const won = teamScore > oppScore;
          const result = won ? 'W' : 'L';
    
          recentResults.push(`${result} ${teamScore}-${oppScore} vs ${oppTeam}`);
    
          if (streakCount === 0) {
            streakType = result;
            streakCount = 1;
          } else if (result === streakType) {
            streakCount++;
          } else {
            break;
          }
    
          if (recentResults.length >= 10) break;
        }
    
        const streakText =
          streakType === 'W'
            ? `${streakCount} game winning streak`
            : `${streakCount} game losing streak`;
    
        return `${teamAbbrev} Current Streak: ${streakText}\n\nLast 10 games:\n${recentResults.join('\n')}`;
      } catch (error: any) {
        return `Error analyzing streak: ${error.message}`;
      }
    }
  • Tool dispatcher case that extracts the teamAbbrev parameter and invokes the analyzeStreak handler function.
    case 'get_team_streak': {
      const streak = await analyzeStreak(parameters.teamAbbrev as string);
      return {
        content: [{ type: 'text', text: streak }],
      };
    }
  • src/index.ts:178-191 (registration)
    Tool registration in the TOOLS array, including name, description, and input schema for listing available tools.
    {
      name: 'get_team_streak',
      description: 'Get current winning or losing streak for an NHL team based on recent game results.',
      inputSchema: {
        type: 'object',
        properties: {
          teamAbbrev: {
            type: 'string',
            description: 'Team abbreviation (e.g., TOR, NYR)',
          },
        },
        required: ['teamAbbrev'],
      },
    },
  • Input schema defining the required 'teamAbbrev' parameter for the get_team_streak tool.
    inputSchema: {
      type: 'object',
      properties: {
        teamAbbrev: {
          type: 'string',
          description: 'Team abbreviation (e.g., TOR, NYR)',
        },
      },
      required: ['teamAbbrev'],
    },
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 mentions the tool retrieves streak information 'based on recent game results,' which hints at read-only behavior, but doesn't clarify data freshness, rate limits, error handling, or authentication needs. This leaves significant gaps in understanding how the tool behaves beyond its basic function.

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, well-structured sentence that efficiently conveys the tool's purpose without unnecessary words. It is front-loaded with the main action and resource, making it easy to parse quickly. Every part of the sentence earns its place by specifying the scope ('NHL team') and basis ('recent game results').

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 the tool's low complexity (one parameter, no output schema, no annotations), the description is adequate but incomplete. It explains what the tool does but lacks details on behavioral aspects like data sources or limitations. Without annotations or an output schema, the description should provide more context to fully guide the agent, but it meets the minimum viable threshold.

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, with the parameter 'teamAbbrev' clearly documented. The description doesn't add any additional meaning beyond what the schema provides, such as examples of abbreviations or constraints. Since the schema does the heavy lifting, a baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 winning or losing streak for an NHL team'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'get_team_stats' or 'get_standings' that might also provide streak-related information, which prevents 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 minimal usage guidance by mentioning 'based on recent game results,' which implies context but doesn't specify when to use this tool versus alternatives like 'get_team_stats' or 'get_standings.' No explicit when-to-use or when-not-to-use instructions are included, leaving the agent to infer usage scenarios.

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