Skip to main content
Glama
test-get-function.js•2.17 kB
/** * Test GetFunction handler * Tests retrieving function module source code */ const { initializeTestEnvironment, getAllEnabledTestCases, printTestHeader, printTestParams, printTestResult } = require('./test-helper'); // Initialize test environment initializeTestEnvironment(); const { handleGetFunction } = require('../dist/handlers/handleGetFunction'); async function testGetFunction() { // Try get_function_test first, fallback to get_function let testCases = getAllEnabledTestCases('get_function_test'); if (testCases.length === 0) { testCases = getAllEnabledTestCases('get_function'); } console.log(`\nšŸ“‹ Found ${testCases.length} enabled test case(s)\n`); let passedTests = 0; let failedTests = 0; for (const testCase of testCases) { printTestHeader('GetFunction', testCase); const params = testCase.params; // Map function_module_name to function_name and function_group_name to function_group if (params.function_module_name && !params.function_name) { params.function_name = params.function_module_name; } if (params.function_group_name && !params.function_group) { params.function_group = params.function_group_name; } printTestParams(params); console.log('--- Retrieving function module ---\n'); try { const result = await handleGetFunction(params); if (printTestResult(result, 'GetFunction')) { passedTests++; } else { failedTests++; } } catch (error) { console.error('āŒ Unexpected error:'); console.error(error); failedTests++; } console.log('\n' + '='.repeat(60) + '\n'); } console.log(`\nšŸ“Š Test Summary:`); console.log(` āœ… Passed: ${passedTests}`); console.log(` āŒ Failed: ${failedTests}`); console.log(` šŸ“ Total: ${testCases.length}`); if (failedTests > 0) { process.exit(1); } } // Run the test testGetFunction() .then(() => { console.log('\n=== All tests completed successfully ==='); process.exit(0); }) .catch(error => { console.error('\n=== Tests failed ==='); console.error(error); process.exit(1); });

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