search_tools
Search over 508 software products by name or keyword to find their category, rating, free plan availability, starting price, and URL.
Instructions
Search 508+ software products by name or keyword. Returns name, category, rating, free plan availability, starting price, and ComparEdge URL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query string (product name, keyword, or use case) | |
| limit | No | Maximum number of results to return (default: 5) |
Implementation Reference
- index.js:205-250 (handler)The main handler function for search_tools. Accepts query and optional limit, fetches all tools, scores by relevance (name, slug, description, category), filters, sorts, and returns formatted results.
async function searchTools(args) { const { query, limit = 5 } = args; const q = query.toLowerCase(); const allTools = await getAllTools(); // Score each tool by relevance const scored = allTools .map(t => { let score = 0; const name = (t.name || '').toLowerCase(); const slug = (t.slug || '').toLowerCase(); const desc = (t.description || '').toLowerCase(); const cat = (t.categoryName || t.category || '').toLowerCase(); if (name === q) score += 100; else if (name.startsWith(q)) score += 60; else if (name.includes(q)) score += 40; if (slug.includes(q)) score += 30; if (desc.includes(q)) score += 20; if (cat.includes(q)) score += 15; return { t, score }; }) .filter(x => x.score > 0) .sort((a, b) => b.score - a.score || (b.t.rating ?? 0) - (a.t.rating ?? 0)) .slice(0, limit) .map(x => x.t); if (scored.length === 0) { return `No results found for "${query}".`; } const lines = scored.map((t, i) => { const rating = t.rating ? `${t.rating}/5` : 'N/A'; const free = t.freePlan ? 'Yes' : 'No'; const price = t.startingPrice !== undefined ? formatPrice(t.startingPrice) : 'N/A'; return [ `${i + 1}. ${t.name} (${t.slug})`, ` Category: ${t.categoryName || t.category || 'N/A'}`, ` Rating: ${rating} | Free plan: ${free} | Starting price: ${price}`, ` URL: ${toolURL(t.slug)}`, ].join('\n'); }); return `Search results for "${query}" (${scored.length} found):\n\n${lines.join('\n\n')}`; } - index.js:70-79 (schema)Input schema definition for search_tools: requires 'query' (string), optional 'limit' (number, default 5).
name: 'search_tools', description: 'Search 508+ software products by name or keyword. Returns name, category, rating, free plan availability, starting price, and ComparEdge URL.', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query string (product name, keyword, or use case)' }, limit: { type: 'number', description: 'Maximum number of results to return (default: 5)' }, }, required: ['query'], }, - index.js:448-450 (registration)Dispatch table in callTool() that routes 'search_tools' to the searchTools handler function.
async function callTool(name, args) { switch (name) { case 'search_tools': return searchTools(args); - index.js:483-484 (registration)tools/list handler returns TOOL_DEFINITIONS array which includes the search_tools definition.
if (method === 'tools/list') { return makeResponse(id, { tools: TOOL_DEFINITIONS });