Skip to main content
Glama
test-get-domain.js•1.87 kB
/** * Test script for GetDomain MCP tool * Tests reading domain information from SAP system * * Configuration is loaded from tests/test-config.yaml */ const { initializeTestEnvironment, getAllEnabledTestCases, printTestHeader, printTestParams, printTestResult } = require('./test-helper'); // Initialize test environment before importing handlers initializeTestEnvironment(); const { handleGetDomain } = require('../dist/handlers/handleGetDomain'); async function testGetDomain() { // Load all enabled test cases from YAML const testCases = getAllEnabledTestCases('get_domain'); console.log(`\nšŸ“‹ Found ${testCases.length} enabled test case(s)\n`); let passedTests = 0; let failedTests = 0; for (const testCase of testCases) { printTestHeader('GetDomain', testCase); // Test parameters from YAML const testArgs = testCase.params; printTestParams(testArgs); console.log('--- Starting domain retrieval ---\n'); try { const result = await handleGetDomain(testArgs); if (printTestResult(result, 'GetDomain')) { passedTests++; } else { failedTests++; } } catch (error) { console.error('āŒ Unexpected error during domain retrieval:'); console.error(error); failedTests++; } console.log('\n' + '='.repeat(60) + '\n'); } // Print summary console.log('\nšŸ“Š Test Summary:'); console.log(` āœ… Passed: ${passedTests}`); console.log(` āŒ Failed: ${failedTests}`); console.log(` šŸ“ Total: ${testCases.length}`); if (failedTests === 0) { console.log('\n=== All tests completed successfully ===\n'); process.exit(0); } else { console.log('\n=== Some tests failed ===\n'); process.exit(1); } } // Run tests testGetDomain().catch(error => { console.error('Fatal 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