UNPKG

@flexabrain/mcp-server

Version:

Advanced electrical schematic analysis MCP server with rail engineering expertise

157 lines 4.43 kB
/** * FlexaBrain MCP Server - Tool Implementation Handlers * * Implementation handlers for all MCP tools related to PDF schematic processing * and FlexaBrain AI agent integration. */ import { SchematicDatabase } from '../database/database-interface.js'; import { PDFProcessor } from '../services/pdf-processor.js'; import { EnhancedOCRService } from '../services/enhanced-ocr-service.js'; import { AgentIntegrationManager } from '../integration/agent-integration-strategy.js'; import { PDFProcessingOptions } from '../types/pdf-schematic.js'; export interface ToolContext { database: SchematicDatabase; pdfProcessor: PDFProcessor; ocrService: EnhancedOCRService; agentManager: AgentIntegrationManager; } export declare class FlexaBrainToolHandlers { private db; private pdfProcessor; private ocrService; private agentManager; constructor(context: ToolContext); /** * Handle analyze-pdf-schematic tool */ analyzePDFSchematic(args: { file_path: string; document_type: string; processing_options?: PDFProcessingOptions; rail_system_type?: string; voltage_system?: string; priority?: string; enable_ai_analysis?: boolean; }): Promise<{ document_id: string; status: string; processing_started: boolean; estimated_completion?: string; message: string; }>; /** * Handle get-schematic-data tool */ getSchematicData(args: { document_id: string; include_components?: boolean; include_cross_references?: boolean; include_ai_analysis?: boolean; component_type_filter?: string[]; confidence_threshold?: number; page_range?: { start_page: number; end_page: number; }; }): Promise<{ document: any; pages: any[]; components: any[]; cross_references: any[]; ai_analysis: any[]; statistics: any; }>; /** * Handle get-processing-status tool */ getProcessingStatus(args: { document_id: string; include_logs?: boolean; include_statistics?: boolean; }): Promise<{ document_id: string; status: string; progress: number; started_at?: string; completed_at?: string; statistics?: any; logs?: any[]; errors?: any[]; }>; /** * Handle search-components tool */ searchComponents(args: { search_query: string; document_id?: string; component_types?: string[]; safety_levels?: string[]; compliance_status?: string[]; confidence_range?: { min: number; max: number; }; limit?: number; }): Promise<{ components: any[]; total_found: number; search_query: string; filters_applied: any; }>; /** * Handle trigger-ai-analysis tool */ triggerAIAnalysis(args: { document_id: string; component_ids?: string[]; agents?: string[]; analysis_types?: string[]; priority?: string; force_reanalysis?: boolean; }): Promise<{ analysis_triggered: boolean; agents_used: string[]; components_analyzed: number; estimated_completion: string; analysis_ids: string[]; }>; /** * Handle update-component-data tool */ updateComponentData(args: { component_id: string; updates: any; annotation?: any; verification?: any; }): Promise<{ updated: boolean; component_id: string; changes_applied: string[]; annotation_added?: boolean; verification_status?: string; }>; /** * Handle export-schematic-data tool */ exportSchematicData(args: { document_id: string; export_format?: string; include_data?: any; filter_options?: any; output_path?: string; }): Promise<{ exported: boolean; format: string; file_path?: string; data_size: number; export_timestamp: string; }>; /** * Private helper methods */ private processDocumentAsync; private estimateCompletion; private calculateProgress; } export default FlexaBrainToolHandlers; //# sourceMappingURL=tool-handlers.d.ts.map