first
This commit is contained in:
59
get-all-tools.js
Normal file
59
get-all-tools.js
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Get all MCP tools for documentation
|
||||
*/
|
||||
|
||||
// Set environment variables
|
||||
process.env.LARAVEL_API_BASE_URL = 'https://example.com';
|
||||
|
||||
console.log('📋 Getting all MCP tools...\n');
|
||||
|
||||
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 }) => {
|
||||
try {
|
||||
const config = new ConfigManager();
|
||||
const authManager = new AuthManager(null, config.getAll(true));
|
||||
const apiClient = new ApiClient(config.getAll(), authManager);
|
||||
const toolGenerator = new ToolGenerator(apiClient);
|
||||
|
||||
const tools = toolGenerator.generateAllTools();
|
||||
|
||||
const publicTools = tools.filter(tool => {
|
||||
const toolDef = toolGenerator.getTool(tool.name);
|
||||
return toolDef?.authType === 'public';
|
||||
});
|
||||
|
||||
const providerTools = tools.filter(tool => {
|
||||
const toolDef = toolGenerator.getTool(tool.name);
|
||||
return toolDef?.authType === 'provider';
|
||||
});
|
||||
|
||||
console.log(`Total tools: ${tools.length}`);
|
||||
console.log(`Public tools: ${publicTools.length}`);
|
||||
console.log(`Provider tools: ${providerTools.length}\n`);
|
||||
|
||||
console.log('=== ALL PUBLIC TOOLS ===');
|
||||
publicTools.forEach((tool, i) => {
|
||||
const toolDef = toolGenerator.getTool(tool.name);
|
||||
console.log(`${tool.name.padEnd(40)} # ${toolDef?.endpoint?.description || tool.description}`);
|
||||
});
|
||||
|
||||
console.log('\n=== ALL PROVIDER TOOLS ===');
|
||||
providerTools.forEach((tool, i) => {
|
||||
const toolDef = toolGenerator.getTool(tool.name);
|
||||
console.log(`${tool.name.padEnd(40)} # ${toolDef?.endpoint?.description || tool.description}`);
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ Error:', error.message);
|
||||
console.error('Stack:', error.stack);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}).catch(error => {
|
||||
console.error('❌ Import error:', error.message);
|
||||
});
|
Reference in New Issue
Block a user