Skip to main content
Glama
argotdev

NHL MCP Server

by argotdev

get_goalie_stats

Retrieve NHL goalie statistics including save percentage, goals against average, wins, and shutouts for specified seasons.

Instructions

Get statistics for NHL goalies including save percentage, GAA, wins, shutouts, and other goalie-specific metrics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of goalies to return (defaults to 20)
seasonNoSeason in format YYYYYYYY (e.g., 20242025), defaults to current season

Implementation Reference

  • Handler for get_goalie_stats tool that fetches top goalie stats via NHLAPIClient and formats them for output.
    case 'get_goalie_stats': {
      const goalies = await client.getTopGoalies(
        parameters.limit as number | undefined,
        parameters.season as string | undefined
      );
      const formatted = formatGoalieStats(goalies, 'savePctg');
      return {
        content: [{ type: 'text', text: formatted }],
      };
    }
  • src/index.ts:109-125 (registration)
    Registration of the get_goalie_stats tool in the TOOLS array, including name, description, and input schema.
    {
      name: 'get_goalie_stats',
      description: 'Get statistics for NHL goalies including save percentage, GAA, wins, shutouts, and other goalie-specific metrics.',
      inputSchema: {
        type: 'object',
        properties: {
          limit: {
            type: 'number',
            description: 'Number of goalies to return (defaults to 20)',
          },
          season: {
            type: 'string',
            description: 'Season in format YYYYYYYY (e.g., 20242025), defaults to current season',
          },
        },
      },
    },
  • TypeScript interface defining the structure of GoalieStats returned by the tool.
    export interface GoalieStats {
      id: number;
      firstName: {
        default: string;
      };
      lastName: {
        default: string;
      };
      sweaterNumber: number;
      headshot: string;
      teamAbbrev: string;
      teamName: {
        default: string;
      };
      teamLogo: string;
      position: string;
      value: number; // The stat value (savePctg, wins, etc.)
    }
  • Helper method in NHLAPIClient that fetches top goalie statistics from the NHL API endpoints.
    async getTopGoalies(limit: number = 20, season?: string): Promise<GoalieStats[]> {
      const seasonStr = season || this.getCurrentSeason();
      const category = 'savePctg'; // Default to save percentage
    
      if (!season) {
        // Use current stats leaders endpoint
        const data = await this.fetchJSON(
          `${NHL_API_BASE}/goalie-stats-leaders/current?categories=${category}&limit=${limit}`
        );
        return data[category] || [];
      } else {
        // Use seasonal stats leaders endpoint
        const data = await this.fetchJSON(
          `${NHL_API_BASE}/goalie-stats-leaders/${seasonStr}/2?categories=${category}&limit=${limit}`
        );
        return data[category] || [];
      }
    }
  • Utility function to format goalie statistics into a readable markdown table.
    function formatGoalieStats(goalies: GoalieStats[], category: string): string {
      let result = `Rank | Goalie | Team | ${category.toUpperCase()}\n`;
      result += '-'.repeat(60) + '\n';
    
      goalies.forEach((goalie, index) => {
        const name = `${goalie.firstName.default} ${goalie.lastName.default}`;
        const displayName = name.substring(0, 25).padEnd(25);
        const team = goalie.teamAbbrev.padEnd(4);
        const value = category === 'savePctg'
          ? goalie.value.toFixed(3)
          : goalie.value.toString();
        const rank = (index + 1).toString().padStart(3);
    
        result += `${rank} | ${displayName} | ${team} | ${value}\n`;
      });
    
      return result;
    }
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 the types of statistics returned but fails to describe critical behaviors like rate limits, authentication needs, error handling, or whether the data is real-time or historical. This leaves significant gaps for an agent to understand operational constraints.

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

Conciseness4/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 and lists key metrics without unnecessary details. It avoids redundancy and waste, though it could be slightly more structured by separating usage context from the metric list.

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 no annotations and no output schema, the description is incomplete for a tool with behavioral complexity. It omits details on return format (e.g., structured data, pagination), error cases, and how statistics are calculated or sourced, which are essential for an agent to use the tool effectively in varied contexts.

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 ('limit' and 'season') with defaults and formats. The description adds no additional parameter semantics beyond what the schema provides, such as explaining how 'limit' affects ranking or what 'season' encompasses. Baseline 3 is appropriate as the schema handles the heavy lifting.

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 ('NHL goalies'), listing key metrics like save percentage, GAA, wins, and shutouts. It distinguishes itself from sibling tools like 'get_player_stats' by focusing on goalie-specific data, though it doesn't explicitly contrast with them.

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, such as 'get_player_stats' for non-goalie players or 'get_team_stats' for team-level data. It lacks context on prerequisites, exclusions, or specific scenarios where this tool is most appropriate.

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