get_stats
Retrieve unread article counts and feed statistics from FreshRSS to monitor RSS feed activity and track reading progress.
Instructions
Get unread counts and statistics
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/stats-handlers.ts:17-43 (handler)The implementation of the get_stats tool handler, which fetches and formats statistics from the FreshRSS client.
wrapTool('get_stats', async () => { const stats = await client.stats.getStatistics(); const lines = [ `## FreshRSS Statistics`, `**Total Unread:** ${stats.totalUnread.toString()}`, '', '### Top Feeds by Unread Count', ]; const topFeeds = stats.feeds.sort((a, b) => b.count - a.count).slice(0, 10); for (const feed of topFeeds) { const feedId = feed.id.replace('feed/', ''); lines.push(`- ${feedId}: ${feed.count.toString()} unread`); } if (stats.categories.length > 0) { lines.push('', '### Categories'); for (const cat of stats.categories) { const name = cat.id.replace('user/-/label/', ''); lines.push(`- ${name}: ${cat.count.toString()} unread`); } } return textResult(lines.join('\n')); }) - src/handlers/stats-handlers.ts:11-16 (registration)Registration of the get_stats tool within the MCP server.
server.registerTool( 'get_stats', { description: 'Get unread counts and statistics', inputSchema: z.object({}).strict(), },