@spaik/mcp-server-roi
Version:
MCP server for AI ROI prediction and tracking with Monte Carlo simulations
308 lines • 10.8 kB
TypeScript
import { z } from 'zod';
/**
* Metadata Enricher Service
*
* Enhances responses with confidence scores, data quality metrics,
* assumption tracking, and contextual metadata for AI agents.
*/
export declare const DataQualityMetricsSchema: z.ZodObject<{
completeness: z.ZodNumber;
accuracy: z.ZodNumber;
consistency: z.ZodNumber;
timeliness: z.ZodNumber;
overall: z.ZodEnum<["low", "medium", "high"]>;
}, "strip", z.ZodTypeAny, {
overall: "low" | "medium" | "high";
accuracy: number;
completeness: number;
consistency: number;
timeliness: number;
}, {
overall: "low" | "medium" | "high";
accuracy: number;
completeness: number;
consistency: number;
timeliness: number;
}>;
export declare const ConfidenceMetricsSchema: z.ZodObject<{
overall: z.ZodNumber;
breakdown: z.ZodObject<{
data_quality: z.ZodNumber;
model_accuracy: z.ZodNumber;
assumption_validity: z.ZodNumber;
benchmark_alignment: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
data_quality: number;
model_accuracy: number;
assumption_validity: number;
benchmark_alignment: number;
}, {
data_quality: number;
model_accuracy: number;
assumption_validity: number;
benchmark_alignment: number;
}>;
factors: z.ZodArray<z.ZodObject<{
factor: z.ZodString;
impact: z.ZodEnum<["positive", "negative"]>;
weight: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
impact: "positive" | "negative";
factor: string;
weight: number;
}, {
impact: "positive" | "negative";
factor: string;
weight: number;
}>, "many">;
}, "strip", z.ZodTypeAny, {
overall: number;
factors: {
impact: "positive" | "negative";
factor: string;
weight: number;
}[];
breakdown: {
data_quality: number;
model_accuracy: number;
assumption_validity: number;
benchmark_alignment: number;
};
}, {
overall: number;
factors: {
impact: "positive" | "negative";
factor: string;
weight: number;
}[];
breakdown: {
data_quality: number;
model_accuracy: number;
assumption_validity: number;
benchmark_alignment: number;
};
}>;
export declare const AssumptionTrackingSchema: z.ZodObject<{
assumptions: z.ZodArray<z.ZodObject<{
id: z.ZodString;
category: z.ZodString;
description: z.ZodString;
confidence: z.ZodNumber;
impact: z.ZodEnum<["low", "medium", "high"]>;
sensitivity: z.ZodOptional<z.ZodNumber>;
validation_method: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id: string;
description: string;
category: string;
impact: "low" | "medium" | "high";
confidence: number;
sensitivity?: number | undefined;
validation_method?: string | undefined;
}, {
id: string;
description: string;
category: string;
impact: "low" | "medium" | "high";
confidence: number;
sensitivity?: number | undefined;
validation_method?: string | undefined;
}>, "many">;
overall_impact: z.ZodEnum<["low", "medium", "high"]>;
key_dependencies: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
assumptions: {
id: string;
description: string;
category: string;
impact: "low" | "medium" | "high";
confidence: number;
sensitivity?: number | undefined;
validation_method?: string | undefined;
}[];
overall_impact: "low" | "medium" | "high";
key_dependencies: string[];
}, {
assumptions: {
id: string;
description: string;
category: string;
impact: "low" | "medium" | "high";
confidence: number;
sensitivity?: number | undefined;
validation_method?: string | undefined;
}[];
overall_impact: "low" | "medium" | "high";
key_dependencies: string[];
}>;
export declare const ContextualMetadataSchema: z.ZodObject<{
industry_context: z.ZodOptional<z.ZodObject<{
industry: z.ZodString;
market_maturity: z.ZodEnum<["emerging", "growing", "mature", "declining"]>;
competitive_intensity: z.ZodEnum<["low", "medium", "high"]>;
regulatory_complexity: z.ZodEnum<["low", "medium", "high"]>;
}, "strip", z.ZodTypeAny, {
industry: string;
market_maturity: "emerging" | "growing" | "mature" | "declining";
competitive_intensity: "low" | "medium" | "high";
regulatory_complexity: "low" | "medium" | "high";
}, {
industry: string;
market_maturity: "emerging" | "growing" | "mature" | "declining";
competitive_intensity: "low" | "medium" | "high";
regulatory_complexity: "low" | "medium" | "high";
}>>;
organization_context: z.ZodOptional<z.ZodObject<{
size: z.ZodEnum<["small", "medium", "large", "enterprise"]>;
ai_maturity: z.ZodEnum<["beginner", "intermediate", "advanced", "leader"]>;
change_readiness: z.ZodEnum<["low", "medium", "high"]>;
resource_availability: z.ZodEnum<["constrained", "adequate", "abundant"]>;
}, "strip", z.ZodTypeAny, {
size: "medium" | "small" | "large" | "enterprise";
ai_maturity: "beginner" | "intermediate" | "advanced" | "leader";
change_readiness: "low" | "medium" | "high";
resource_availability: "constrained" | "adequate" | "abundant";
}, {
size: "medium" | "small" | "large" | "enterprise";
ai_maturity: "beginner" | "intermediate" | "advanced" | "leader";
change_readiness: "low" | "medium" | "high";
resource_availability: "constrained" | "adequate" | "abundant";
}>>;
temporal_context: z.ZodObject<{
analysis_date: z.ZodString;
data_freshness: z.ZodEnum<["real-time", "recent", "historical"]>;
projection_horizon: z.ZodString;
seasonality_considered: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
analysis_date: string;
data_freshness: "real-time" | "recent" | "historical";
projection_horizon: string;
seasonality_considered: boolean;
}, {
analysis_date: string;
data_freshness: "real-time" | "recent" | "historical";
projection_horizon: string;
seasonality_considered: boolean;
}>;
calculation_context: z.ZodObject<{
methodology: z.ZodString;
key_parameters: z.ZodRecord<z.ZodString, z.ZodAny>;
sensitivity_tested: z.ZodBoolean;
scenario_count: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
methodology: string;
key_parameters: Record<string, any>;
sensitivity_tested: boolean;
scenario_count: number;
}, {
methodology: string;
key_parameters: Record<string, any>;
sensitivity_tested: boolean;
scenario_count: number;
}>;
}, "strip", z.ZodTypeAny, {
temporal_context: {
analysis_date: string;
data_freshness: "real-time" | "recent" | "historical";
projection_horizon: string;
seasonality_considered: boolean;
};
calculation_context: {
methodology: string;
key_parameters: Record<string, any>;
sensitivity_tested: boolean;
scenario_count: number;
};
industry_context?: {
industry: string;
market_maturity: "emerging" | "growing" | "mature" | "declining";
competitive_intensity: "low" | "medium" | "high";
regulatory_complexity: "low" | "medium" | "high";
} | undefined;
organization_context?: {
size: "medium" | "small" | "large" | "enterprise";
ai_maturity: "beginner" | "intermediate" | "advanced" | "leader";
change_readiness: "low" | "medium" | "high";
resource_availability: "constrained" | "adequate" | "abundant";
} | undefined;
}, {
temporal_context: {
analysis_date: string;
data_freshness: "real-time" | "recent" | "historical";
projection_horizon: string;
seasonality_considered: boolean;
};
calculation_context: {
methodology: string;
key_parameters: Record<string, any>;
sensitivity_tested: boolean;
scenario_count: number;
};
industry_context?: {
industry: string;
market_maturity: "emerging" | "growing" | "mature" | "declining";
competitive_intensity: "low" | "medium" | "high";
regulatory_complexity: "low" | "medium" | "high";
} | undefined;
organization_context?: {
size: "medium" | "small" | "large" | "enterprise";
ai_maturity: "beginner" | "intermediate" | "advanced" | "leader";
change_readiness: "low" | "medium" | "high";
resource_availability: "constrained" | "adequate" | "abundant";
} | undefined;
}>;
export type DataQualityMetrics = z.infer<typeof DataQualityMetricsSchema>;
export type ConfidenceMetrics = z.infer<typeof ConfidenceMetricsSchema>;
export type AssumptionTracking = z.infer<typeof AssumptionTrackingSchema>;
export type ContextualMetadata = z.infer<typeof ContextualMetadataSchema>;
export declare class MetadataEnricher {
private logger;
/**
* Enrich response with comprehensive metadata
*/
enrichResponse(response: any, tool: string, executionContext: any): Promise<{
confidence: ConfidenceMetrics;
dataQuality: DataQualityMetrics;
assumptions: AssumptionTracking;
context: ContextualMetadata;
provenance: any;
}>;
/**
* Calculate comprehensive confidence metrics
*/
private calculateConfidence;
/**
* Assess data quality metrics
*/
private assessDataQuality;
/**
* Track and analyze assumptions
*/
private trackAssumptions;
/**
* Gather contextual metadata
*/
private gatherContextualMetadata;
/**
* Generate provenance information
*/
private generateProvenance;
private assessROIModelAccuracy;
private assessComparativeBenchmarks;
private assessDataCompleteness;
private assessAssumptionValidity;
private identifyConfidenceFactors;
private checkMetricConsistency;
private assessMarketMaturity;
private assessRegulatoryComplexity;
private inferAIMaturity;
private inferResourceAvailability;
private getMethodologyName;
private countScenarios;
private generateExecutionId;
private identifyDataSources;
private identifyCalculationMethods;
private identifyExternalAPIs;
}
export declare const metadataEnricher: MetadataEnricher;
//# sourceMappingURL=metadata-enricher.d.ts.map