#!/usr/bin/env node /** * Check if tools are actually being generated by the MCP server */ console.log("šŸ” Checking generated MCP tools...\n"); // Import the MCP server modules import("./src/tools/ToolGenerator.js") .then(async ({ ToolGenerator }) => { import("./src/proxy/ApiClient.js") .then(async ({ ApiClient }) => { import("./src/auth/AuthManager.js") .then(async ({ AuthManager }) => { import("./src/config/ConfigManager.js") .then(async ({ ConfigManager }) => { import("./src/config/endpoints.js") .then(async (endpointsModule) => { try { console.log("šŸ“‹ Loading MCP server components..."); // Initialize components const config = new ConfigManager(); const authManager = new AuthManager( null, config.getAll(true) ); const apiClient = new ApiClient( config.getAll(true), authManager ); const toolGenerator = new ToolGenerator( apiClient, authManager ); console.log("āœ… Components loaded successfully\n"); // Generate tools console.log("šŸ”§ Generating tools..."); const tools = toolGenerator.generateAllTools(); console.log(`āœ… Generated ${tools.length} tools\n`); // Look for the specific tool const loginTool = tools.find( (tool) => tool.name === "public_create_login" ); if (loginTool) { console.log("āœ… Found public_post_login tool:"); console.log(JSON.stringify(loginTool, null, 2)); } else { console.log("āŒ public_post_login tool NOT FOUND!"); // Show tools that contain 'login' const loginTools = tools.filter((tool) => tool.name.includes("login") ); console.log( `\nšŸ” Found ${loginTools.length} tools containing 'login':` ); loginTools.forEach((tool) => { console.log(` - ${tool.name}`); }); // Show first few public tools const publicTools = tools.filter((tool) => tool.name.startsWith("public_") ); console.log(`\nšŸ“‹ First 10 public tools:`); publicTools.slice(0, 10).forEach((tool) => { console.log(` - ${tool.name}`); }); } // Check endpoint configuration console.log("\nšŸ“Š Checking endpoint configuration..."); const { PUBLIC_ENDPOINTS } = endpointsModule; const loginEndpoint = PUBLIC_ENDPOINTS.find( (ep) => ep.path === "/api/login" ); if (loginEndpoint) { console.log( "āœ… Found /api/login endpoint in configuration:" ); console.log(JSON.stringify(loginEndpoint, null, 2)); } else { console.log( "āŒ /api/login endpoint NOT FOUND in configuration!" ); } // Summary console.log("\nšŸ“ˆ SUMMARY:"); console.log(`Total tools generated: ${tools.length}`); console.log( `Public tools: ${ tools.filter((t) => t.name.startsWith("public_")) .length }` ); console.log( `Provider tools: ${ tools.filter((t) => t.name.startsWith("provider_")) .length }` ); console.log( `Patient tools: ${ tools.filter((t) => t.name.startsWith("patient_")) .length }` ); console.log( `Partner tools: ${ tools.filter((t) => t.name.startsWith("partner_")) .length }` ); console.log( `Affiliate tools: ${ tools.filter((t) => t.name.startsWith("affiliate_")) .length }` ); console.log( `Network tools: ${ tools.filter((t) => t.name.startsWith("network_")) .length }` ); } catch (error) { console.error("āŒ Error:", error.message); console.error(error.stack); } }) .catch((error) => { console.error("āŒ Error loading endpoints:", error.message); }); }) .catch((error) => { console.error("āŒ Error loading ConfigManager:", error.message); }); }) .catch((error) => { console.error("āŒ Error loading AuthManager:", error.message); }); }) .catch((error) => { console.error("āŒ Error loading ApiClient:", error.message); }); }) .catch((error) => { console.error("āŒ Error loading ToolGenerator:", error.message); });