get_rankings
Retrieve consensus player rankings for NFL or NBA fantasy sports, filterable by position and scoring type to inform draft and lineup decisions.
Instructions
Get consensus rankings for a sport
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sport | Yes | Sport to get rankings for | |
| position | No | Position to filter by | |
| scoring | No | Scoring type (for NFL) |
Implementation Reference
- src/index.ts:242-262 (handler)The handler function that implements the core logic of the 'get_rankings' tool by querying the FantasyPros API for consensus rankings.private async getRankings(args: any) { const { sport, position = 'ALL', scoring = 'STD' } = args; const season = new Date().getFullYear().toString(); const params: any = { position, scoring, }; const response = await this.axiosInstance.get( `/${sport}/${season}/consensus-rankings`, { params } ); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; }
- src/index.ts:98-121 (registration)Registration of the 'get_rankings' tool in the listTools handler, including its metadata and input schema.{ name: 'get_rankings', description: 'Get consensus rankings for a sport', inputSchema: { type: 'object', properties: { sport: { type: 'string', enum: ['nfl', 'nba'], description: 'Sport to get rankings for', }, position: { type: 'string', description: 'Position to filter by', }, scoring: { type: 'string', enum: ['STD', 'PPR', 'HALF'], description: 'Scoring type (for NFL)', }, }, required: ['sport'], }, },
- src/index.ts:179-180 (registration)The switch case in the CallToolRequest handler that dispatches calls to the 'get_rankings' tool to its handler method.case 'get_rankings': return await this.getRankings(request.params.arguments);
- src/index.ts:101-120 (schema)The input schema defining parameters for the 'get_rankings' tool.inputSchema: { type: 'object', properties: { sport: { type: 'string', enum: ['nfl', 'nba'], description: 'Sport to get rankings for', }, position: { type: 'string', description: 'Position to filter by', }, scoring: { type: 'string', enum: ['STD', 'PPR', 'HALF'], description: 'Scoring type (for NFL)', }, }, required: ['sport'], },