Skip to main content
Glama
test_api.js2.01 kB
// Simple test script to compare the three API endpoints const testEndpoints = async () => { const baseUrl = 'https://cmp-mcp-server.zlinoliver.workers.dev/mcp'; // Test data for each endpoint const tests = [ { name: "SIM List (Known Working)", endpoint: "/sim/page", data: { pageNum: 1, pageSize: 5 } }, { name: "SIM Detail (Known Working)", endpoint: "/sim/detail", data: { iccid: "8932042000002328543" } }, { name: "SIM Usage (New API)", endpoint: "/sim/queryMonthData", data: { iccid: "8932042000002328543", month: "202310" } } ]; for (const test of tests) { console.log(`\n🧪 Testing: ${test.name}`); console.log(`📍 Endpoint: ${test.endpoint}`); console.log(`📊 Data: ${JSON.stringify(test.data)}`); try { const response = await fetch(baseUrl, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json, text/event-stream', 'Mcp-Session-Id': 'test-session-' + Date.now() }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "tools/call", params: { name: "test_api", arguments: { endpoint: test.endpoint, data: JSON.stringify(test.data) } } }) }); const result = await response.text(); console.log(`✅ Response: ${result}`); } catch (error) { console.log(`❌ Error: ${error.message}`); } console.log('─'.repeat(50)); } }; testEndpoints();

Latest Blog Posts

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/Acceleronix/cmp-mcp-server'

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