Skip to main content
Glama
josuekongolo

CompanyIQ MCP Server

by josuekongolo
growth_scorer.ts1.53 kB
export interface GrowthMetrics { revenueGrowth: number; employeeGrowth: number; assetGrowth: number; overallGrowthScore: number; growthCategory: 'high' | 'moderate' | 'stable' | 'declining'; } export class GrowthScorer { calculateGrowth(current: number, previous: number): number { if (!previous || previous === 0) return 0; return ((current - previous) / previous) * 100; } scoreGrowth(financialHistory: any[]): GrowthMetrics | null { if (financialHistory.length < 2) return null; const latest = financialHistory[0]; const previous = financialHistory[1]; const revenueGrowth = this.calculateGrowth(latest.revenue, previous.revenue); const employeeGrowth = this.calculateGrowth(latest.employees, previous.employees); const assetGrowth = this.calculateGrowth(latest.assets, previous.assets); // Weighted average const overallGrowthScore = ( revenueGrowth * 0.5 + employeeGrowth * 0.3 + assetGrowth * 0.2 ); let growthCategory: GrowthMetrics['growthCategory']; if (overallGrowthScore >= 50) growthCategory = 'high'; else if (overallGrowthScore >= 20) growthCategory = 'moderate'; else if (overallGrowthScore >= 0) growthCategory = 'stable'; else growthCategory = 'declining'; return { revenueGrowth: Math.round(revenueGrowth), employeeGrowth: Math.round(employeeGrowth), assetGrowth: Math.round(assetGrowth), overallGrowthScore: Math.round(overallGrowthScore), growthCategory }; } }

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