get_sport_news
Retrieve sports news for NFL, MLB, NBA, or NHL with filtering options for injury reports, game recaps, transactions, rumors, and breaking news to support fantasy sports decisions.
Instructions
Get news for a specific sport
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sport | Yes | Sport to get news for | |
| limit | No | Number of news items to return (max 25) | |
| category | No | Type of news to show |
Implementation Reference
- src/index.ts:210-224 (handler)The main handler function for 'get_sport_news' tool. It extracts parameters like sport, limit, and category, makes an API call to FantasyPros /${sport}/news endpoint, and returns the JSON response as text content.private async getNews(args: any) { const { sport, limit = 25, category } = args; const params: any = { limit }; if (category) params.category = category; const response = await this.axiosInstance.get(`/${sport}/news`, { params }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; }
- src/index.ts:56-77 (schema)Input schema definition for the 'get_sport_news' tool, specifying parameters like sport (required, enum), limit, and category.inputSchema: { type: 'object', properties: { sport: { type: 'string', enum: ['nfl', 'mlb', 'nba', 'nhl'], description: 'Sport to get news for', }, limit: { type: 'number', description: 'Number of news items to return (max 25)', minimum: 1, maximum: 25, }, category: { type: 'string', enum: ['injury', 'recap', 'transaction', 'rumor', 'breaking'], description: 'Type of news to show', }, }, required: ['sport'], },
- src/index.ts:53-78 (registration)Tool registration in the ListToolsRequestSchema handler, including name, description, and input schema.{ name: 'get_sport_news', description: 'Get news for a specific sport', inputSchema: { type: 'object', properties: { sport: { type: 'string', enum: ['nfl', 'mlb', 'nba', 'nhl'], description: 'Sport to get news for', }, limit: { type: 'number', description: 'Number of news items to return (max 25)', minimum: 1, maximum: 25, }, category: { type: 'string', enum: ['injury', 'recap', 'transaction', 'rumor', 'breaking'], description: 'Type of news to show', }, }, required: ['sport'], }, },
- src/index.ts:175-176 (registration)Dispatch case in the CallToolRequestSchema handler that routes to the getNews handler function.case 'get_sport_news': return await this.getNews(request.params.arguments);