Skip to main content
Glama
argotdev

NHL MCP Server

by argotdev

get_live_games

Retrieve live NHL game scores, period status, and venue details for today or a specified date to track ongoing hockey matches.

Instructions

Get live NHL game scores and status for today or a specific date. Shows current scores, period, game state, and venue information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoDate in YYYY-MM-DD format (optional, defaults to today)

Implementation Reference

  • MCP tool handler for 'get_live_games' that fetches games via NHLAPIClient.getTodaysScores, handles empty case, formats output using formatGameScore, and returns as MCP content.
    case 'get_live_games': {
      const games = await client.getTodaysScores(parameters.date as string | undefined);
      if (games.length === 0) {
        return {
          content: [
            { type: 'text', text: 'No games scheduled for this date' },
          ],
        };
      }
      const formatted = games.map(formatGameScore).join('\n\n');
      return {
        content: [{ type: 'text', text: formatted }],
      };
    }
  • Tool schema definition in the TOOLS array, including name, description, and inputSchema for date parameter.
    {
      name: 'get_live_games',
      description: 'Get live NHL game scores and status for today or a specific date. Shows current scores, period, game state, and venue information.',
      inputSchema: {
        type: 'object',
        properties: {
          date: {
            type: 'string',
            description: 'Date in YYYY-MM-DD format (optional, defaults to today)',
          },
        },
      },
    },
  • src/index.ts:460-462 (registration)
    Registration of the tool list handler that returns the TOOLS array containing 'get_live_games'.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: TOOLS };
    });
  • Core implementation in NHLAPIClient that fetches live game scores from NHL API for a given date.
    async getTodaysScores(date?: string): Promise<GameScore[]> {
      const dateStr = date || new Date().toISOString().split('T')[0];
      const data = await this.fetchJSON(`${NHL_API_BASE}/score/${dateStr}`);
      return data.games || [];
    }
  • Helper function to format individual game score information for display.
    function formatGameScore(game: GameScore): string {
      const status =
        game.gameState === 'LIVE' || game.gameState === 'CRIT'
          ? `LIVE - Period ${game.period}`
          : game.gameState === 'FUT'
          ? 'Scheduled'
          : game.gameState === 'FINAL' || game.gameState === 'OFF'
          ? 'Final'
          : game.gameState;
    
      return `${game.awayTeam.abbrev} ${game.awayTeam.score} @ ${game.homeTeam.abbrev} ${game.homeTeam.score} - ${status}\nVenue: ${game.venue}\nDate: ${game.gameDate}\nGame ID: ${game.id}`;
    }
Behavior3/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 describes what information is returned (scores, period, game state, venue) but doesn't mention rate limits, authentication needs, error conditions, or whether data is real-time vs cached. It adequately covers the core behavior but lacks operational details.

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 efficiently structured in two sentences with zero waste. The first sentence establishes purpose and scope, the second details the returned information. Every phrase adds value without redundancy or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only tool with one well-documented parameter and no output schema, the description is reasonably complete. It covers purpose, scope, and return information. However, without annotations or output schema, it could benefit from mentioning response format or data freshness, though not strictly required for basic functionality.

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 fully documents the single optional date parameter. The description adds marginal value by mentioning 'today or a specific date' context, but doesn't provide additional syntax or format details beyond what the schema specifies. 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.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get'), resource ('live NHL game scores and status'), and scope ('for today or a specific date'). It distinguishes from siblings like get_schedule (future games) and get_game_details (specific game details) by focusing on live games with current status.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('for today or a specific date'), but doesn't explicitly state when not to use it or name alternatives. It implies usage for live game information rather than historical stats or schedules, though no explicit exclusions are given.

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