UNPKG

@spaik/mcp-server-roi

Version:

MCP server for AI ROI prediction and tracking with Monte Carlo simulations

154 lines 4.46 kB
import { z } from 'zod'; export declare const BenchmarkDataSchema: z.ZodObject<{ industry: z.ZodString; metric: z.ZodString; value: z.ZodNumber; unit: z.ZodString; percentile: z.ZodOptional<z.ZodNumber>; source: z.ZodString; date: z.ZodString; confidence: z.ZodNumber; citations: z.ZodOptional<z.ZodArray<z.ZodObject<{ url: z.ZodString; title: z.ZodString; }, "strip", z.ZodTypeAny, { title: string; url: string; }, { title: string; url: string; }>, "many">>; }, "strip", z.ZodTypeAny, { value: number; industry: string; date: string; metric: string; unit: string; confidence: number; source: string; percentile?: number | undefined; citations?: { title: string; url: string; }[] | undefined; }, { value: number; industry: string; date: string; metric: string; unit: string; confidence: number; source: string; percentile?: number | undefined; citations?: { title: string; url: string; }[] | undefined; }>; export type BenchmarkData = z.infer<typeof BenchmarkDataSchema>; declare const BenchmarkRequestSchema: z.ZodObject<{ industry: z.ZodEnum<["financial_services", "healthcare", "retail", "manufacturing", "technology", "education", "government", "other"]>; metrics: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; company_size: z.ZodOptional<z.ZodEnum<["small", "medium", "large", "enterprise"]>>; region: z.ZodOptional<z.ZodString>; use_case_type: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { industry: "financial_services" | "healthcare" | "retail" | "manufacturing" | "technology" | "education" | "government" | "other"; metrics?: string[] | undefined; company_size?: "medium" | "small" | "large" | "enterprise" | undefined; region?: string | undefined; use_case_type?: string | undefined; }, { industry: "financial_services" | "healthcare" | "retail" | "manufacturing" | "technology" | "education" | "government" | "other"; metrics?: string[] | undefined; company_size?: "medium" | "small" | "large" | "enterprise" | undefined; region?: string | undefined; use_case_type?: string | undefined; }>; export type BenchmarkRequest = z.infer<typeof BenchmarkRequestSchema>; interface SonarConfig { apiKey: string; baseUrl?: string; model?: 'sonar' | 'sonar-pro'; timeout?: number; maxRetries?: number; } export declare class SonarBenchmarkService { private logger; private config; private cache; private cacheTTL; constructor(config: SonarConfig); /** * Fetch industry benchmarks from Sonar API */ fetchBenchmarks(request: BenchmarkRequest): Promise<BenchmarkData[]>; /** * Fetch specific ROI benchmarks for a use case */ fetchROIBenchmarks(industry: string, useCase: string, companySize?: string): Promise<{ expectedROI: number; paybackPeriod: number; successRate: number; citations: Array<{ url: string; title: string; }>; }>; /** * Validate benchmark data freshness */ validateBenchmarkFreshness(benchmarks: BenchmarkData[]): Promise<{ isValid: boolean; outdatedMetrics: string[]; }>; /** * Build a structured prompt for benchmark queries */ private buildBenchmarkPrompt; /** * Call the Perplexity Sonar API */ private callSonarAPI; /** * Parse Sonar response into structured benchmark data */ private parseSonarResponse; /** * Parse ROI-specific response */ private parseROIResponse; /** * Extract citations from Sonar API response */ private extractCitations; /** * Calculate confidence based on number of citations */ private calculateConfidence; /** * Get company size range for context */ private getCompanySizeRange; /** * Generate cache key for requests */ private generateCacheKey; /** * Get static fallback benchmarks when API fails */ private getStaticFallbackBenchmarks; /** * Clear the cache */ clearCache(): void; /** * Get cache statistics */ getCacheStats(): { size: number; entries: string[]; }; } export {}; //# sourceMappingURL=sonar-benchmark-service.d.ts.map