Skip to main content
Glama
test-final-comparison.jsโ€ข5.96 kB
const { spawn } = require('child_process'); const path = require('path'); /** * Final comparison test showing the difference between minimal and detailed modes */ async function testFinalComparison() { console.log('๐ŸŽฏ FINAL COMPARISON: Minimal vs Detailed Modes\n'); const serverPath = path.join(__dirname, '..', 'dist', 'index.js'); console.log('๐Ÿงช Testing CL_BUS_ABSTRACT_MAIN_SCREEN class...\n'); // Test minimal mode console.log('๐Ÿ“‹ MINIMAL MODE (detailed=false):'); const minimalResult = await callMcpTool(serverPath, { method: 'tools/call', params: { name: 'GetWhereUsed', arguments: { object_name: 'CL_BUS_ABSTRACT_MAIN_SCREEN', object_type: 'class', detailed: false } } }); if (!minimalResult.error) { const minimalResponse = JSON.parse(minimalResult.content[0].text); console.log(` โœ… Found: ${minimalResponse.total_found}, Showing: ${minimalResponse.total_references}, Filtered: ${minimalResponse.filtered_out}`); console.log(` ๐ŸŽฏ Key findings:`); minimalResponse.references.slice(0, 5).forEach((ref, i) => { console.log(` ${i + 1}. ${ref.name} (${ref.type}) ${ref.isResult ? 'โญ' : ''}`); }); } else { console.log(` โŒ Error:`, minimalResult.error); } console.log(''); // Test detailed mode console.log('๐Ÿ“‹ DETAILED MODE (detailed=true):'); const detailedResult = await callMcpTool(serverPath, { method: 'tools/call', params: { name: 'GetWhereUsed', arguments: { object_name: 'CL_BUS_ABSTRACT_MAIN_SCREEN', object_type: 'class', detailed: true } } }); if (!detailedResult.error) { const detailedResponse = JSON.parse(detailedResult.content[0].text); console.log(` โœ… Found: ${detailedResponse.total_found}, Showing: ${detailedResponse.total_references}, Filtered: ${detailedResponse.filtered_out}`); console.log(` ๐Ÿ” All references (first 10):`); detailedResponse.references.slice(0, 10).forEach((ref, i) => { const usage = ref.usageInformation || 'no usage info'; console.log(` ${i + 1}. ${ref.name} (${ref.type}) - ${usage} ${ref.isResult ? 'โญ' : ''}`); }); if (detailedResponse.references.length > 10) { console.log(` ... and ${detailedResponse.references.length - 10} more`); } } else { console.log(` โŒ Error:`, detailedResult.error); } console.log('\n๐ŸŽฏ SUMMARY:'); if (!minimalResult.error && !detailedResult.error) { const minimalResponse = JSON.parse(minimalResult.content[0].text); const detailedResponse = JSON.parse(detailedResult.content[0].text); console.log(` ๐Ÿ“Š Minimal mode: Shows ${minimalResponse.total_references}/${minimalResponse.total_found} most relevant results`); console.log(` ๐Ÿ“Š Detailed mode: Shows ${detailedResponse.total_references}/${detailedResponse.total_found} all results`); console.log(` ๐ŸŽฏ Filtering efficiency: ${Math.round((minimalResponse.filtered_out / minimalResponse.total_found) * 100)}% noise reduction`); console.log('\n ๐Ÿ” What gets filtered out in minimal mode:'); console.log(' โŒ Class internal sections (Public/Private/Protected Section)'); console.log(' โŒ Internal class methods and attributes'); console.log(' โŒ Package references (organizational structure)'); console.log(' โŒ Function groups (shows only specific functions)'); console.log(' โŒ Programs/includes without direct usage'); console.log('\n โœ… What stays in minimal mode:'); console.log(' โญ Enhancement implementations (ENHO/XHH)'); console.log(' โญ Main results marked as important'); console.log(' โญ Function modules with direct usage'); } } /** * Call MCP tool via stdio */ function callMcpTool(serverPath, request) { return new Promise((resolve, reject) => { const child = spawn('node', [serverPath], { stdio: ['pipe', 'pipe', 'pipe'] }); let stdout = ''; let stderr = ''; child.stdout.on('data', (data) => { stdout += data.toString(); }); child.stderr.on('data', (data) => { stderr += data.toString(); }); child.on('close', (code) => { if (code !== 0) { reject(new Error(`Process exited with code ${code}. Stderr: ${stderr}`)); return; } try { const lines = stdout.trim().split('\n'); let result = null; for (const line of lines) { try { const parsed = JSON.parse(line); if (parsed.result) { result = parsed.result; break; } } catch (e) { // Skip non-JSON lines } } if (result) { resolve(result); } else { reject(new Error('No valid result found in output')); } } catch (error) { reject(new Error(`Failed to parse output: ${error.message}`)); } }); const jsonRpcRequest = { jsonrpc: '2.0', id: 1, ...request }; child.stdin.write(JSON.stringify(jsonRpcRequest) + '\n'); child.stdin.end(); }); } // Run the test testFinalComparison().catch(console.error);

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fr0ster/mcp-abap-adt'

If you have feedback or need assistance with the MCP directory API, please join our Discord server