get_players
Retrieve detailed player information for NFL, MLB, NBA, or NHL sports to support fantasy sports research and decision-making.
Instructions
Get player information for a specific sport
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sport | Yes | Sport to get players for | |
| playerId | No | Filter by specific player ID |
Implementation Reference
- src/index.ts:226-240 (handler)The handler function that executes the get_players tool: fetches player data from FantasyPros API for the specified sport and optional playerId, returns JSON response.private async getPlayers(args: any) { const { sport, playerId } = args; const params: any = {}; if (playerId) params.player = playerId; const response = await this.axiosInstance.get(`/${sport}/players`, { params }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; }
- src/index.ts:82-96 (schema)Input schema for the get_players tool, defining sport (required, enum) and optional playerId.inputSchema: { type: 'object', properties: { sport: { type: 'string', enum: ['nfl', 'mlb', 'nba', 'nhl'], description: 'Sport to get players for', }, playerId: { type: 'string', description: 'Filter by specific player ID', }, }, required: ['sport'], },
- src/index.ts:79-97 (registration)Registration of the get_players tool in the tools list returned by ListToolsRequestHandler.{ name: 'get_players', description: 'Get player information for a specific sport', inputSchema: { type: 'object', properties: { sport: { type: 'string', enum: ['nfl', 'mlb', 'nba', 'nhl'], description: 'Sport to get players for', }, playerId: { type: 'string', description: 'Filter by specific player ID', }, }, required: ['sport'], }, },
- src/index.ts:177-178 (registration)Dispatch/registration in the CallToolRequestHandler switch statement, routing to the getPlayers handler.case 'get_players': return await this.getPlayers(request.params.arguments);