Skip to main content
Glama
test-update-domain.js•2.29 kB
/** * Test script for UpdateDomain MCP tool * Tests the complete flow: get, lock, update, check, unlock, activate, verify * * Configuration is loaded from tests/test-config.yaml * Update transport_request in the YAML before running tests! */ const { initializeTestEnvironment, getAllEnabledTestCases, validateTransportRequest, printTestHeader, printTestParams, printTestResult, waitForConfirmation } = require('./test-helper'); // Initialize test environment before importing handlers initializeTestEnvironment(); const { handleUpdateDomain } = require('../dist/handlers/handleUpdateDomain'); async function testUpdateDomain() { // Load all enabled test cases from YAML const testCases = getAllEnabledTestCases('update_domain'); console.log(`\nšŸ“‹ Found ${testCases.length} enabled test case(s)\n`); let passedTests = 0; let failedTests = 0; for (const testCase of testCases) { printTestHeader('UpdateDomain', testCase); // Test parameters from YAML const testArgs = testCase.params; // Validate transport request if (!validateTransportRequest(testArgs)) { await waitForConfirmation( 'āš ļø Using default transport request! Update test-config.yaml with a valid request.', 5 ); } printTestParams(testArgs); console.log('--- Starting domain update flow ---\n'); try { const result = await handleUpdateDomain(testArgs); if (printTestResult(result, 'UpdateDomain')) { passedTests++; } else { failedTests++; } } catch (error) { console.error('āŒ Unexpected error during domain update:'); 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) { process.exit(1); } } // Run the test testUpdateDomain() .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