get_team_stats
Retrieve comprehensive NHL team statistics including roster details, season performance metrics, and individual player data for analysis and comparison.
Instructions
Get detailed statistics for a specific NHL team including roster, season performance, and player stats.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| teamAbbrev | Yes | Team abbreviation (e.g., TOR, NYR, BOS, MTL) | |
| season | No | Season in format YYYYYYYY (e.g., 20242025), defaults to current season |
Implementation Reference
- src/index.ts:517-525 (handler)Handler for the 'get_team_stats' tool in the CallToolRequestSchema switch statement. Extracts parameters and calls client.getTeamStats(), returning JSON-formatted stats.case 'get_team_stats': { const stats = await client.getTeamStats( parameters.teamAbbrev as string, parameters.season as string | undefined ); return { content: [{ type: 'text', text: JSON.stringify(stats, null, 2) }], }; }
- src/index.ts:70-87 (registration)Registration of the 'get_team_stats' tool in the TOOLS array used for ListToolsRequestSchema response.{ name: 'get_team_stats', description: 'Get detailed statistics for a specific NHL team including roster, season performance, and player stats.', inputSchema: { type: 'object', properties: { teamAbbrev: { type: 'string', description: 'Team abbreviation (e.g., TOR, NYR, BOS, MTL)', }, season: { type: 'string', description: 'Season in format YYYYYYYY (e.g., 20242025), defaults to current season', }, }, required: ['teamAbbrev'], }, },
- src/index.ts:73-86 (schema)Input schema definition for the get_team_stats tool, specifying required teamAbbrev and optional season.inputSchema: { type: 'object', properties: { teamAbbrev: { type: 'string', description: 'Team abbreviation (e.g., TOR, NYR, BOS, MTL)', }, season: { type: 'string', description: 'Season in format YYYYYYYY (e.g., 20242025), defaults to current season', }, }, required: ['teamAbbrev'], },
- src/nhl-api.ts:236-239 (helper)Helper function in NHLAPI class that fetches team statistics from the NHL API endpoint.async getTeamStats(teamAbbrev: string, season?: string): Promise<any> { const seasonStr = season || this.getCurrentSeason(); return this.fetchJSON(`${NHL_API_BASE}/club-stats/${teamAbbrev}/${seasonStr}/2`); }