Skip to main content
Glama
desktop-client-comparison.cjsβ€’7.05 kB
#!/usr/bin/env node const { spawn } = require('child_process'); const path = require('path'); console.log('πŸ” DESKTOP CLIENT PARAMETER COMPARISON'); console.log('Showing: Wrong approach vs Correct approach'); console.log('Query: "Show AWS amortized costs for last 8 months"'); console.log('════════════════════════════════════════════════\n'); // Start the MCP server const serverPath = path.join(__dirname, 'src', 'index.ts'); const server = spawn('npx', ['tsx', serverPath], { env: { ...process.env }, stdio: ['pipe', 'pipe', 'pipe'] }); let serverReady = false; let step = 0; server.stderr.on('data', (data) => { const output = data.toString(); if (output.includes('Umbrella MCP Server started successfully')) { serverReady = true; authenticate(); } }); server.stdout.on('data', (data) => { const text = data.toString(); const lines = text.split('\n'); for (const line of lines) { if (line.trim() && line.includes('"result"')) { try { const response = JSON.parse(line); if (response.id === 1 && text.includes('Successfully authenticated')) { console.log('βœ… Authentication successful\n'); setTimeout(() => testWrongApproach(), 2000); } else if (response.id === 2) { console.log('❌ **WRONG APPROACH RESULT (Desktop Client\'s Current Behavior)**'); analyzeResponse(response, 'WRONG'); setTimeout(() => testCorrectApproach(), 2000); } else if (response.id === 3) { console.log('βœ… **CORRECT APPROACH RESULT (What Desktop Client Should Do)**'); analyzeResponse(response, 'CORRECT'); displaySummary(); server.kill(); process.exit(0); } } catch (e) { // Continue } } } }); function authenticate() { console.log('πŸ” Authenticating...\n'); const authRequest = { jsonrpc: '2.0', method: 'tools/call', params: { name: 'authenticate_user', arguments: { username: 'david+saola@umbrellacost.com', password: 'Dsamsung1!' } }, id: 1 }; server.stdin.write(JSON.stringify(authRequest) + '\n'); } function testWrongApproach() { console.log('πŸ“€ Testing WRONG approach (Desktop Client\'s current parameters)...'); console.log('Parameters: costType="cost", isUnblended="false"\n'); // Simulate what desktop client is actually doing const wrongRequest = { jsonrpc: '2.0', method: 'tools/call', params: { name: 'api___invoices_caui', arguments: { "startDate": "2024-12-01", "endDate": "2025-08-24", "periodGranLevel": "month", "groupBy": "none", "costType": "cost", // ❌ WRONG - ignored by API "isUnblended": "false", // ❌ WRONG - doesn't work "cloud_context": "aws" } }, id: 2 }; server.stdin.write(JSON.stringify(wrongRequest) + '\n'); } function testCorrectApproach() { console.log('\nπŸ“€ Testing CORRECT approach (What artifact teaches)...'); console.log('Parameters: isAmortized="true" (no other cost parameters)\n'); // What desktop client SHOULD do based on our artifact const correctRequest = { jsonrpc: '2.0', method: 'tools/call', params: { name: 'api___invoices_caui', arguments: { "accountId": "932213950603", // βœ… Always required "startDate": "2024-12-01", "endDate": "2025-08-24", "periodGranLevel": "month", "groupBy": "none", "cloud_context": "aws", "isAmortized": "true" // βœ… CORRECT for regular amortized // NO costType parameter // NO isUnblended parameter } }, id: 3 }; server.stdin.write(JSON.stringify(correctRequest) + '\n'); } function analyzeResponse(response, type) { const content = response.result?.content?.find(c => c.type === 'text')?.text || ''; // Check server message if (content.includes('You requested regular amortized costs, but this endpoint returns unblended costs')) { console.log(' 🚨 Server says: "Returns unblended costs" (parameters ignored)'); } else if (content.includes('regular amortized costs')) { console.log(' βœ… Server says: "Returns regular amortized costs"'); } // Extract sample cost const jsonMatch = content.match(/```json\\n([\\s\\S]*?)\\n```/); if (jsonMatch) { try { const data = JSON.parse(jsonMatch[1]); if (Array.isArray(data) && data.length > 0) { const march2025 = data.find(item => item.usage_date === '2025-03'); if (march2025) { const cost = parseFloat(march2025.total_cost); console.log(` πŸ’° March 2025 Cost: $${cost.toLocaleString('en-US', {minimumFractionDigits: 2})}`); if (type === 'WRONG') { console.log(` πŸ“Š This is UNBLENDED cost (not amortized as requested)`); } else { console.log(` πŸ“Š This is REGULAR AMORTIZED cost (as requested)`); } } } } catch (e) { console.log(' ❌ JSON parsing failed'); } } } function displaySummary() { console.log('\n' + '═'.repeat(80)); console.log('πŸ“‹ **DESKTOP CLIENT PARAMETER ANALYSIS SUMMARY**'); console.log('═'.repeat(80)); console.log(); console.log('**CURRENT PROBLEM:**'); console.log('❌ Desktop client uses: costType="cost", isUnblended="false"'); console.log('❌ API ignores these parameters and returns unblended costs'); console.log('❌ Server explicitly says "returns unblended costs"'); console.log('❌ User asks for amortized but gets unblended data'); console.log(); console.log('**SOLUTION:**'); console.log('βœ… Desktop client should use: isAmortized="true"'); console.log('βœ… Remove costType and isUnblended parameters completely'); console.log('βœ… API correctly returns regular amortized costs'); console.log('βœ… March 2025: $108,832 (amortized) vs $104,755 (unblended)'); console.log(); console.log('**KEY INSIGHT FROM MCP LOGS:**'); console.log('β€’ Desktop client made 4+ API calls with wrong parameters'); console.log('β€’ Every call returned unblended costs (same $104,755 for March)'); console.log('β€’ Server kept saying "returns unblended costs" (ignored parameters)'); console.log('β€’ With correct parameters, March 2025 should be $108,832 (amortized)'); console.log(); console.log('**ARTIFACT ENHANCEMENT NEEDED:**'); console.log('β€’ Add explicit warnings about costType parameter'); console.log('β€’ Emphasize isAmortized="true" is the ONLY way to get amortized costs'); console.log('β€’ Show exact parameter comparison (wrong vs right)'); console.log(); console.log('🎯 **DESKTOP CLIENT MUST FOLLOW ARTIFACT EXACTLY**'); } setTimeout(() => { if (!serverReady) { console.error('❌ Server timeout'); server.kill(); process.exit(1); } }, 15000);

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/daviddraiumbrella/invoice-monitoring'

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