get_alternatives
Find top-rated alternatives to a software tool within its category, sorted by user ratings.
Instructions
Find top alternatives to a given software tool within the same category, sorted by rating.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | Slug of the tool to find alternatives for | |
| limit | No | Maximum number of alternatives to return (default: 5) |
Implementation Reference
- index.js:356-376 (handler)The handler function for 'get_alternatives'. Finds the target tool by slug, then filters all tools to find other tools in the same category, sorted by rating descending, limited by the limit parameter. Returns a formatted text response with the top alternatives.
async function getAlternatives(args) { const { slug, limit = 5 } = args; const allTools = await getAllTools(); const target = allTools.find(t => t.slug === slug); if (!target) return `Tool with slug "${slug}" not found.`; const alternatives = allTools .filter(t => t.slug !== slug && t.category === target.category) .sort((a, b) => (b.rating ?? 0) - (a.rating ?? 0)) .slice(0, limit); if (alternatives.length === 0) { return `No alternatives found for "${target.name}" in category "${target.categoryName || target.category}".`; } const lines = alternatives.map((t, i) => `${i + 1}. ${t.name} | Rating: ${t.rating ?? 'N/A'}/5 | Free: ${t.freePlan ? 'Yes' : 'No'} | Price: ${formatPrice(t.startingPrice)} | ${toolURL(t.slug)}` ); return `Top alternatives to ${target.name} in ${target.categoryName || target.category}:\n\n${lines.join('\n')}\n\nFull list: ${SITE_BASE}/alternatives/${slug}-alternatives`; } - index.js:117-128 (schema)The tool definition / input schema for 'get_alternatives'. Defines name, description, and inputSchema with 'slug' (required) and 'limit' (optional, default 5).
{ name: 'get_alternatives', description: 'Find top alternatives to a given software tool within the same category, sorted by rating.', inputSchema: { type: 'object', properties: { slug: { type: 'string', description: 'Slug of the tool to find alternatives for' }, limit: { type: 'number', description: 'Maximum number of alternatives to return (default: 5)' }, }, required: ['slug'], }, }, - index.js:454-454 (registration)The dispatch/registration for 'get_alternatives' in the callTool switch statement that routes the tool name to the handler function.
case 'get_alternatives':return getAlternatives(args);