first
This commit is contained in:
158
check-generated-tools.js
Normal file
158
check-generated-tools.js
Normal file
@@ -0,0 +1,158 @@
|
||||
#!/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);
|
||||
});
|
Reference in New Issue
Block a user