compare_tools
Compare two sales tools side-by-side on API type, authentication, pricing, MCP support, AI capabilities, and SDKs.
Instructions
Compare two sales tools side-by-side — API type, auth, pricing, MCP support, AI capabilities, and SDKs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tool1 | Yes | Slug of the first tool (e.g., 'hubspot') | |
| tool2 | Yes | Slug of the second tool (e.g., 'pipedrive') |
Implementation Reference
- index.js:150-188 (handler)The main handler function for the 'compare_tools' tool. Fetches details for two tools by slug from the API and produces a side-by-side comparison table covering category, API type, auth, free tier, MCP readiness, webhooks, SDKs, AI capabilities, and links.
async function handleCompare(args) { const { tool1, tool2 } = args; try { const [t1, t2] = await Promise.all([ fetchJSON(`${BASE_URL}/api/tools/${encodeURIComponent(tool1)}`), fetchJSON(`${BASE_URL}/api/tools/${encodeURIComponent(tool2)}`), ]); if (t1.error) return { content: [{ type: "text", text: `Tool "${tool1}" not found.` }] }; if (t2.error) return { content: [{ type: "text", text: `Tool "${tool2}" not found.` }] }; let text = `# ${t1.name} vs ${t2.name}\n\n`; text += `| Feature | ${t1.name} | ${t2.name} |\n`; text += `|---------|${'-'.repeat(t1.name.length + 2)}|${'-'.repeat(t2.name.length + 2)}|\n`; text += `| Category | ${t1.category} | ${t2.category} |\n`; text += `| API Type | ${(t1.apiType || []).join(', ')} | ${(t2.apiType || []).join(', ')} |\n`; text += `| Auth | ${(t1.authMethod || []).join(', ')} | ${(t2.authMethod || []).join(', ')} |\n`; text += `| Free Tier | ${t1.hasFreeTier ? '✅' : '❌'} | ${t2.hasFreeTier ? '✅' : '❌'} |\n`; text += `| MCP Ready | ${t1.mcpReady ? '✅' : '❌'} | ${t2.mcpReady ? '✅' : '❌'} |\n`; text += `| Webhooks | ${t1.hasWebhooks ? '✅' : '❌'} | ${t2.hasWebhooks ? '✅' : '❌'} |\n`; text += `| SDKs | ${(t1.sdkLanguages || []).join(', ') || 'None'} | ${(t2.sdkLanguages || []).join(', ') || 'None'} |\n`; text += '\n'; if (t1.aiCapabilities?.length > 0 || t2.aiCapabilities?.length > 0) { text += `## AI Capabilities\n`; text += `**${t1.name}:** ${(t1.aiCapabilities || []).join(', ') || 'Not listed'}\n`; text += `**${t2.name}:** ${(t2.aiCapabilities || []).join(', ') || 'Not listed'}\n\n`; } text += `## Links\n`; text += `- ${t1.name}: https://salestools.club/apis/${t1.slug}\n`; text += `- ${t2.name}: https://salestools.club/apis/${t2.slug}\n`; text += `- Compare page: https://salestools.club/vs/${t1.slug}-vs-${t2.slug}\n`; return { content: [{ type: "text", text: text.trim() }] }; } catch (error) { return { content: [{ type: "text", text: `Comparison failed: ${error.message}` }] }; } } - index.js:273-284 (schema)Registration of the 'compare_tools' tool schema, defining its name, description, and inputSchema (requiring two strings: tool1 and tool2 slugs).
{ name: "compare_tools", description: "Compare two sales tools side-by-side — API type, auth, pricing, MCP support, AI capabilities, and SDKs.", inputSchema: { type: "object", properties: { tool1: { type: "string", description: "Slug of the first tool (e.g., 'hubspot')" }, tool2: { type: "string", description: "Slug of the second tool (e.g., 'pipedrive')" }, }, required: ["tool1", "tool2"], }, }, - index.js:310-310 (registration)The dispatcher/call-router that matches the tool name 'compare_tools' to the handleCompare function.
case "compare_tools": return handleCompare(args); - index.js:41-45 (helper)The fetchJSON helper used by handleCompare to fetch tool data from the external API.
async function fetchJSON(url) { const response = await fetch(url, { signal: AbortSignal.timeout(10000) }); if (!response.ok) throw new Error(`API error: ${response.status} ${response.statusText}`); return response.json(); }