Skip to main content
Glama
josuekongolo

CompanyIQ MCP Server

by josuekongolo
test-smart-scraper.jsβ€’2.68 kB
import { SmartScraper } from './build/scraper/smart_scraper.js'; async function testSmartScraper() { console.log('πŸš€ Testing Smart Scraper (No Browser Automation)'); console.log('================================================\n'); const scraper = new SmartScraper(); const orgNr = '999059198'; // Company with multiple years console.log(`πŸ“Š Scraping financial data for ${orgNr}...\n`); try { const startTime = Date.now(); const results = await scraper.getAllFinancialYears(orgNr); const duration = Math.round((Date.now() - startTime) / 1000); console.log('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); console.log('πŸ“Š SCRAPING RESULTS'); console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'); console.log(`βœ… Successfully processed ${results.length} years in ${duration} seconds\n`); // Group results by data availability const withData = results.filter(r => r.revenue !== null || r.profit !== null); const withoutData = results.filter(r => r.revenue === null && r.profit === null); console.log(`πŸ“ˆ Years with financial data: ${withData.length}`); withData.forEach(r => { console.log(` ${r.year}: Revenue=${r.revenue ? (r.revenue/1000000).toFixed(1) + 'M' : 'N/A'}, ` + `Profit=${r.profit ? (r.profit/1000000).toFixed(1) + 'M' : 'N/A'} (${r.source})`); }); if (withoutData.length > 0) { console.log(`\n⚠️ Years without data: ${withoutData.length}`); withoutData.forEach(r => { console.log(` ${r.year}: ${r.source}`); }); } // Summary console.log('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'); console.log('πŸ“Š SUMMARY'); console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'); console.log(`Total years found: ${results.length}`); console.log(`Years with data: ${withData.length}`); console.log(`Success rate: ${results.length > 0 ? Math.round(withData.length / results.length * 100) : 0}%`); console.log(`Time taken: ${duration} seconds`); if (duration > 120) { console.log('\n⚠️ WARNING: Took more than 2 minutes - may timeout in MCP'); } else if (duration > 60) { console.log('\n⚠️ Approaching MCP timeout limit'); } else { console.log('\nβœ… Completed well within MCP timeout limit!'); } } catch (error) { console.error('❌ Test failed:', error); } } testSmartScraper();

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/josuekongolo/companyiq-mcp'

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