Skip to main content
Glama
analyze-august-data.tsโ€ข4.47 kB
#!/usr/bin/env npx tsx import { UmbrellaAuth } from './src/auth.js'; import { UmbrellaApiClient } from './src/api-client.js'; async function analyzeAugustData() { console.log('๐Ÿ” ANALYZING AUGUST AWS DATA FOR elisha@umbrellacost.net'); console.log('====================================================='); const auth = new UmbrellaAuth('https://api.umbrellacost.io/api/v1'); const apiClient = new UmbrellaApiClient('https://api.umbrellacost.io/api/v1'); console.log('\n๐Ÿ”‘ Authenticating...'); const authResult = await auth.authenticate({ username: 'elisha@umbrellacost.net', password: 'G37oi57Kp@cNzx' }); apiClient.setAuthToken(authResult); console.log('โœ… Authentication successful'); // Test specific AWS account instead of MultiCloud console.log('\n๐Ÿ” Testing AWS account specifically...'); // Test 1: Try with AWS account ID directly console.log('\n๐Ÿ” Test 1: Direct AWS account query (August 2025)'); const awsAugust = await apiClient.makeRequest('/invoices/caui', { startDate: '2025-08-01', endDate: '2025-08-16', accountId: '322609219825' // AWSTest_3226 account }); // Test 2: Try AWS ALL ACCOUNTS console.log('\n๐Ÿ” Test 2: AWS ALL ACCOUNTS query (August 2025)'); const awsAllAugust = await apiClient.makeRequest('/invoices/caui', { startDate: '2025-08-01', endDate: '2025-08-16', accountId: 'umbrellatestnet_tenant_aws' // AWS ALL ACCOUNTS }); // Test 3: Different date ranges for AWS console.log('\n๐Ÿ” Test 3: AWS July 2025'); const awsJuly = await apiClient.makeRequest('/invoices/caui', { startDate: '2025-07-01', endDate: '2025-07-31', accountId: '322609219825' }); // Test 4: AWS with service grouping (successful pattern from earlier) console.log('\n๐Ÿ” Test 4: AWS with groupBy=service'); const awsGrouped = await apiClient.makeRequest('/invoices/caui', { startDate: '2025-08-01', endDate: '2025-08-16', accountId: '322609219825', groupBy: 'service', costType: 'cost' }); // Test 5: Check what working call from Test 3 earlier actually contained console.log('\n๐Ÿ” Test 5: Recreate successful call (353 records)'); const successful = await apiClient.makeRequest('/invoices/caui', { startDate: '2025-08-01', endDate: '2025-08-16', groupBy: 'service', costType: 'cost', periodGranLevel: 'day' }); console.log('\n๐Ÿ“Š DETAILED DATA ANALYSIS:'); console.log('=========================='); function analyzeResponse(testName: string, response: any) { console.log(`\n๐Ÿ“‹ ${testName}:`); console.log(` Success: ${response.success}`); if (response.success && response.data) { console.log(` Data Type: ${Array.isArray(response.data) ? 'Array' : typeof response.data}`); console.log(` Data Length: ${Array.isArray(response.data) ? response.data.length : 'N/A'}`); if (Array.isArray(response.data) && response.data.length > 0) { const firstItem = response.data[0]; console.log(` First Item Keys: ${Object.keys(firstItem)}`); console.log(` Cost Fields: ${Object.keys(firstItem).filter(k => k.toLowerCase().includes('cost'))}`); // Look for cost values const costFields = Object.keys(firstItem).filter(k => k.toLowerCase().includes('cost') || k.toLowerCase().includes('total') || k.toLowerCase().includes('amount') ); costFields.forEach(field => { console.log(` ${field}: ${firstItem[field]}`); }); } else if (response.data.totalCost !== undefined) { console.log(` Total Cost: ${response.data.totalCost}`); } } else { console.log(` Error: ${response.error}`); } } analyzeResponse('AWS Direct', awsAugust); analyzeResponse('AWS All Accounts', awsAllAugust); analyzeResponse('AWS July', awsJuly); analyzeResponse('AWS Grouped', awsGrouped); analyzeResponse('Successful Call (353 records)', successful); console.log('\n๐ŸŽฏ WHY ZERO COSTS ANALYSIS:'); console.log('==========================='); console.log('1. Check if API returns empty arrays vs non-zero cost values'); console.log('2. Verify which parameters are required for cost data'); console.log('3. Compare successful call (353 records) vs failed calls (0 records)'); console.log('4. Identify required vs optional parameters for cost APIs'); } analyzeAugustData().catch(console.error);

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