get_all_news
Retrieve sports news from FantasyPros for fantasy sports analysis, with filtering by category and adjustable result limits.
Instructions
Get all news from FantasyPros
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of news items to return (max 25) | |
| category | No | Type of news items to show |
Implementation Reference
- src/index.ts:284-298 (handler)The handler function that executes the get_all_news tool. It extracts limit and category from args, makes an API call to FantasyPros '/json/all/news' endpoint, and returns the JSON response as text content.private async getAllNews(args: any) { const { limit = 25, category } = args; const params: any = { limit }; if (category) params.category = category; const response = await this.axiosInstance.get('/json/all/news', { params }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; }
- src/index.ts:152-167 (schema)The input schema defining the parameters for the get_all_news tool: optional limit (1-25) and category (enum of news types).inputSchema: { type: 'object', properties: { 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 items to show', }, }, },
- src/index.ts:149-168 (registration)The tool registration entry in the ListTools handler, specifying name, description, and input schema.{ name: 'get_all_news', description: 'Get all news from FantasyPros', inputSchema: { type: 'object', properties: { 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 items to show', }, }, }, },
- src/index.ts:183-184 (registration)The switch case in the CallToolRequest handler that dispatches to the getAllNews method.case 'get_all_news': return await this.getAllNews(request.params.arguments);