Skip to main content
Glama
argotdev

NHL MCP Server

by argotdev

get_player_stats

Retrieve NHL player statistics including goals, assists, points, plus/minus, and performance metrics. Filter by season, category, and limit results for analysis.

Instructions

Get statistics for top NHL players including goals, assists, points, plus/minus, and other performance metrics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoCategory to sort by: points, goals, assists, plusMinus, shots, shootingPctg (defaults to points)
limitNoNumber of players to return (defaults to 20)
seasonNoSeason in format YYYYYYYY (e.g., 20242025), defaults to current season

Implementation Reference

  • The main handler for the 'get_player_stats' tool within the CallToolRequestSchema switch statement. It extracts parameters, calls client.getTopSkaters to fetch top skaters data, formats it using formatPlayerStats, and returns the formatted text response.
    case 'get_player_stats': {
      const category = (parameters.category as string) || 'points';
      const players = await client.getTopSkaters(
        category,
        parameters.limit as number | undefined,
        parameters.season as string | undefined
      );
      const formatted = formatPlayerStats(players, category);
      return {
        content: [{ type: 'text', text: formatted }],
      };
    }
  • The tool schema definition in the TOOLS array, including name, description, and inputSchema for parameter validation (category, limit, season).
    {
      name: 'get_player_stats',
      description: 'Get statistics for top NHL players including goals, assists, points, plus/minus, and other performance metrics.',
      inputSchema: {
        type: 'object',
        properties: {
          category: {
            type: 'string',
            description: 'Category to sort by: points, goals, assists, plusMinus, shots, shootingPctg (defaults to points)',
          },
          limit: {
            type: 'number',
            description: 'Number of players to return (defaults to 20)',
          },
          season: {
            type: 'string',
            description: 'Season in format YYYYYYYY (e.g., 20242025), defaults to current season',
          },
        },
      },
    },
  • src/index.ts:460-462 (registration)
    Registration of the tool list handler, which returns the TOOLS array containing 'get_player_stats' when ListToolsRequest is called.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: TOOLS };
    });
  • Helper function to format the player stats into a readable table string, used in the handler.
    function formatPlayerStats(players: PlayerStats[], category: string): string {
      let result = `Rank | Player | Team | Pos | ${category.toUpperCase()}\n`;
      result += '-'.repeat(60) + '\n';
    
      players.forEach((player, index) => {
        const name = `${player.firstName.default} ${player.lastName.default}`;
        const displayName = name.substring(0, 25).padEnd(25);
        const team = player.teamAbbrev.padEnd(4);
        const pos = player.position.padEnd(2);
        const value = player.value.toString().padStart(4);
        const rank = (index + 1).toString().padStart(3);
    
        result += `${rank} | ${displayName} | ${team} | ${pos} | ${value}\n`;
      });
    
      return result;
    }
  • Core helper method in NHLAPIClient that fetches top skaters statistics from NHL API endpoints, called by the tool handler.
    async getTopSkaters(category: string = 'points', limit: number = 20, season?: string): Promise<PlayerStats[]> {
      const seasonStr = season || this.getCurrentSeason();
    
      if (!season) {
        // Use current stats leaders endpoint
        const data = await this.fetchJSON(
          `${NHL_API_BASE}/skater-stats-leaders/current?categories=${category}&limit=${limit}`
        );
        return data[category] || [];
      } else {
        // Use seasonal stats leaders endpoint
        const data = await this.fetchJSON(
          `${NHL_API_BASE}/skater-stats-leaders/${seasonStr}/2?categories=${category}&limit=${limit}`
        );
        return data[category] || [];
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what data is returned but doesn't mention whether this is a read-only operation, if it requires authentication, rate limits, error conditions, or response format. For a data retrieval tool with zero annotation coverage, this leaves significant behavioral gaps.

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 gets straight to the point. It's appropriately sized for a straightforward data retrieval tool and front-loads the core purpose without unnecessary elaboration. Every word contributes to understanding what the tool does.

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 read operation with 3 well-documented parameters but no output schema, the description is minimally adequate. It tells what data is returned but doesn't describe the response structure, pagination, or data freshness. With no annotations and no output schema, more context about the return format would be helpful for the agent to understand what to expect.

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?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema - it mentions general statistics but doesn't explain how parameters affect the query. Baseline 3 is appropriate when schema does 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: 'Get statistics for top NHL players including goals, assists, points, plus/minus, and other performance metrics.' It specifies the verb ('Get'), resource ('top NHL players'), and scope of data returned. However, it doesn't explicitly differentiate from sibling tools like 'get_goalie_stats' or 'get_team_stats' beyond implying player focus.

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 doesn't mention sibling tools like 'get_goalie_stats' for goalie-specific data or 'get_team_stats' for team-level statistics. There's no context about prerequisites, limitations, or typical use cases beyond the basic purpose.

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