Skip to main content
Glama
argotdev

NHL MCP Server

by argotdev

get_standings

Retrieve current NHL standings with team statistics like wins, losses, points, and goal differential. Filter results by division or conference to focus on specific league segments.

Instructions

Get current NHL standings including wins, losses, points, goals for/against, and goal differential. Can filter by division or conference.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoDate in YYYY-MM-DD format (optional, defaults to current standings)
divisionNoFilter by division (Atlantic, Metropolitan, Central, Pacific)
conferenceNoFilter by conference (Eastern, Western)

Implementation Reference

  • MCP tool handler for 'get_standings': calls NHLAPIClient.getStandings with optional date, filters by division or conference parameters, formats using formatStandings, returns formatted text.
    case 'get_standings': { const standings = await client.getStandings(parameters.date as string | undefined); let filtered = standings.standings || []; if (parameters.division) { filtered = filtered.filter( (t) => t.divisionAbbrev.toLowerCase() === (parameters.division as string).toLowerCase() ); } if (parameters.conference) { filtered = filtered.filter( (t) => t.conferenceAbbrev.toLowerCase() === (parameters.conference as string).toLowerCase() ); } const formatted = formatStandings(filtered); return { content: [{ type: 'text', text: formatted }], }; }
  • Input schema and metadata for the 'get_standings' tool, defining optional parameters: date, division, conference.
    { name: 'get_standings', description: 'Get current NHL standings including wins, losses, points, goals for/against, and goal differential. Can filter by division or conference.', inputSchema: { type: 'object', properties: { date: { type: 'string', description: 'Date in YYYY-MM-DD format (optional, defaults to current standings)', }, division: { type: 'string', description: 'Filter by division (Atlantic, Metropolitan, Central, Pacific)', }, conference: { type: 'string', description: 'Filter by conference (Eastern, Western)', }, }, }, },
  • src/index.ts:460-462 (registration)
    Registration of all tools list via ListToolsRequestHandler, which returns the TOOLS array including 'get_standings'.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TOOLS }; });
  • formatStandings helper function formats TeamStandings array into a markdown table string used by the handler.
    function formatStandings(standings: TeamStandings[]): string { let result = 'Team | GP | W | L | OT | PTS | GF | GA | DIFF | Div\n'; result += '-'.repeat(70) + '\n'; standings.forEach((team) => { const teamName = team.teamAbbrev.default.padEnd(4); const gp = team.gamesPlayed.toString().padStart(3); const w = team.wins.toString().padStart(2); const l = team.losses.toString().padStart(2); const ot = team.otLosses.toString().padStart(2); const pts = team.points.toString().padStart(3); const gf = team.goalFor.toString().padStart(3); const ga = team.goalAgainst.toString().padStart(3); const diff = team.goalDifferential.toString().padStart(4); const div = team.divisionAbbrev; result += `${teamName} | ${gp} | ${w} | ${l} | ${ot} | ${pts} | ${gf} | ${ga} | ${diff} | ${div}\n`; }); return result; }
  • NHLAPIClient.getStandings implementation: fetches current standings data from NHL API endpoint for given date (defaults to today).
    async getStandings(date?: string): Promise<{ standings: TeamStandings[] }> { const dateStr = date || new Date().toISOString().split('T')[0]; return this.fetchJSON(`${NHL_API_BASE}/standings/${dateStr}`); }

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