get_projections
Retrieve player projections for NFL, MLB, or NBA sports to support fantasy sports decisions. Specify sport, season, and optionally week or position for targeted data.
Instructions
Get player projections for a sport
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sport | Yes | Sport to get projections for | |
| season | Yes | Season year | |
| week | No | Week number (for NFL) | |
| position | No | Position to filter by |
Implementation Reference
- src/index.ts:264-282 (handler)Implements the get_projections tool handler by making an API request to FantasyPros for player projections based on sport, season, optional week, and position.private async getProjections(args: any) { const { sport, season, week, position } = args; const params: any = {}; if (week) params.week = week; if (position) params.position = position; const response = await this.axiosInstance.get( `/${sport}/${season}/projections`, { params } ); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; }
- src/index.ts:125-147 (schema)Defines the input schema for validating arguments to the get_projections tool.inputSchema: { type: 'object', properties: { sport: { type: 'string', enum: ['nfl', 'mlb', 'nba'], description: 'Sport to get projections for', }, season: { type: 'string', description: 'Season year', }, week: { type: 'string', description: 'Week number (for NFL)', }, position: { type: 'string', description: 'Position to filter by', }, }, required: ['sport', 'season'], },
- src/index.ts:122-148 (registration)Registers the get_projections tool in the ListTools response, including name, description, and schema.{ name: 'get_projections', description: 'Get player projections for a sport', inputSchema: { type: 'object', properties: { sport: { type: 'string', enum: ['nfl', 'mlb', 'nba'], description: 'Sport to get projections for', }, season: { type: 'string', description: 'Season year', }, week: { type: 'string', description: 'Week number (for NFL)', }, position: { type: 'string', description: 'Position to filter by', }, }, required: ['sport', 'season'], }, },
- src/index.ts:181-182 (registration)Registers the handler dispatch for get_projections in the CallToolRequestHandler switch statement.case 'get_projections': return await this.getProjections(request.params.arguments);