Skip to main content
Glama
argotdev

NHL MCP Server

by argotdev

get_schedule

Retrieve NHL game schedules for upcoming matches, with options to filter by specific dates or teams using official league data.

Instructions

Get NHL schedule for upcoming games. Can get schedule for a specific date or team.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoDate in YYYY-MM-DD format (optional, defaults to current week)
teamAbbrevNoTeam abbreviation to get specific team schedule (e.g., TOR, NYR)

Implementation Reference

  • The handler for the 'get_schedule' MCP tool. It checks if a teamAbbrev is provided; if so, fetches the team schedule using getTeamSchedule, otherwise fetches the general schedule using getSchedule. Returns the JSON-stringified schedule data.
    case 'get_schedule': { if (parameters.teamAbbrev) { const schedule = await client.getTeamSchedule( parameters.teamAbbrev as string, parameters.season as string | undefined ); return { content: [{ type: 'text', text: JSON.stringify(schedule, null, 2) }], }; } else { const schedule = await client.getSchedule(parameters.date as string | undefined); return { content: [{ type: 'text', text: JSON.stringify(schedule, null, 2) }], }; } }
  • Input schema definition for the 'get_schedule' tool, defining optional 'date' and 'teamAbbrev' parameters.
    inputSchema: { type: 'object', properties: { date: { type: 'string', description: 'Date in YYYY-MM-DD format (optional, defaults to current week)', }, teamAbbrev: { type: 'string', description: 'Team abbreviation to get specific team schedule (e.g., TOR, NYR)', }, }, },
  • src/index.ts:126-142 (registration)
    Registration of the 'get_schedule' tool in the TOOLS array, which is returned by ListToolsRequestHandler. Includes name, description, and input schema.
    { name: 'get_schedule', description: 'Get NHL schedule for upcoming games. Can get schedule for a specific date or team.', inputSchema: { type: 'object', properties: { date: { type: 'string', description: 'Date in YYYY-MM-DD format (optional, defaults to current week)', }, teamAbbrev: { type: 'string', description: 'Team abbreviation to get specific team schedule (e.g., TOR, NYR)', }, }, }, },
  • Core helper function getSchedule in NHLAPIClient that fetches the NHL schedule data from the official API for a given date (defaults to today). Called by the tool handler.
    async getSchedule(date?: string): Promise<any> { const dateStr = date || new Date().toISOString().split('T')[0]; return this.fetchJSON(`${NHL_API_BASE}/schedule/${dateStr}`); }
  • Supporting helper getTeamSchedule used by the get_schedule handler when teamAbbrev is provided. Fetches team-specific schedule from the NHL API.
    async getTeamSchedule(teamAbbrev: string, season?: string): Promise<any> { const seasonStr = season || this.getCurrentSeason(); return this.fetchJSON(`${NHL_API_BASE}/club-schedule-season/${teamAbbrev}/${seasonStr}`); }

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