get_leaderboard
Retrieve top-rated software tools by category, ranked by aggregated G2 and Capterra scores. Filter by category slug or get the overall leaderboard.
Instructions
Get top-rated software tools by category, ranked by aggregated G2 and Capterra scores.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Category slug to filter by, or "all" for overall leaderboard (default: "all") | |
| limit | No | Number of top tools to return (default: 10) |
Implementation Reference
- index.js:416-437 (handler)The getLeaderboard function that executes the tool logic. It fetches all tools, optionally filters by category, sorts by rating descending, slices to the requested limit, and formats the output.
async function getLeaderboard(args) { const { category = 'all', limit = 10 } = args; const allTools = await getAllTools(); let filtered = category === 'all' ? allTools : allTools.filter(t => t.category === category); if (filtered.length === 0) return `No tools found for category "${category}".`; filtered.sort((a, b) => (b.rating ?? 0) - (a.rating ?? 0)); const top = filtered.slice(0, limit); const header = category === 'all' ? `Overall leaderboard (top ${top.length} by rating):` : `Leaderboard for ${top[0]?.categoryName || category} (top ${top.length} by rating):`; const lines = top.map((t, i) => `${String(i + 1).padStart(2)}. ${t.name.padEnd(30)} Rating: ${String(t.rating ?? 'N/A').padEnd(6)} Free: ${t.freePlan ? 'Yes' : 'No'} | ${toolURL(t.slug)}` ); return `${header}\n\n${lines.join('\n')}`; } - index.js:140-150 (schema)The input schema definition for get_leaderboard, specifying the 'category' (string, default 'all') and 'limit' (number, default 10) parameters.
{ name: 'get_leaderboard', description: 'Get top-rated software tools by category, ranked by aggregated G2 and Capterra scores.', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Category slug to filter by, or "all" for overall leaderboard (default: "all")' }, limit: { type: 'number', description: 'Number of top tools to return (default: 10)' }, }, }, }, - index.js:456-456 (registration)Registration/dispatch entry in the callTool switch statement that routes the 'get_leaderboard' tool name to the getLeaderboard function.
case 'get_leaderboard': return getLeaderboard(args);