get_trending
Identify trending wish categories and their velocity from the Wishing Well to inform decision-making.
Instructions
Get trending wish categories and velocity from the Wishing Well.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp-server.js:165-176 (handler)Tool registration and handler definition for 'get_trending'.
// --- Tool: get_trending --- server.tool( 'get_trending', 'Get trending wish categories and velocity from the Wishing Well.', {}, async () => { const trending = queries.getTrending(); return { content: [{ type: 'text', text: JSON.stringify(trending, null, 2) }], }; } ); - src/queries.js:144-157 (helper)Implementation of the 'getTrending' helper function used by the MCP tool.
function getTrending() { const db = getDb(); const topCategories = db.prepare( 'SELECT category, COUNT(*) as count FROM wishes GROUP BY category ORDER BY count DESC' ).all(); const thisWeek = db.prepare( "SELECT COUNT(*) as count FROM wishes WHERE created_at >= date('now', '-7 days')" ).get().count; const today = db.prepare( "SELECT COUNT(*) as count FROM wishes WHERE created_at >= date('now')" ).get().count; return { top_categories: topCategories, wishes_today: today, wishes_this_week: thisWeek }; }