UNPKG

bc-webclient-mcp

Version:

Model Context Protocol (MCP) server for Microsoft Dynamics 365 Business Central via WebUI protocol. Enables AI assistants to interact with BC through the web client protocol, supporting Card, List, and Document pages with full line item support and server

61 lines 1.85 kB
/** * Search Service * * Handles Business Central Tell Me search functionality (Alt+Q). * Uses event-driven architecture to reliably capture asynchronous search results. * * This service layer abstracts the business logic from the MCP tool adapters. */ import type { Result } from '../core/result.js'; import type { BCError } from '../core/errors.js'; export interface SearchResult { id: string; caption: string; type: 'Page' | 'Report' | 'Action' | 'Other'; tooltip?: string; badges?: string[]; navigable: boolean; } export interface SearchResults { query: string; results: SearchResult[]; totalCount: number; sessionId: string; } /** * Service for Business Central search operations */ export declare class SearchService { private readonly parser; constructor(); /** * Search Business Central pages using Tell Me (Alt+Q) */ searchPages(query: string, bcConfig?: { baseUrl: string; username: string; password: string; tenantId: string; }): Promise<Result<SearchResults, BCError>>; /** Validate query and establish connection */ private setupSearchContext; /** Open Tell Me dialog with retry */ private openTellMeDialog; /** Extract search control ID from dialog handlers */ private extractSearchControlId; /** Initialize search (required by BC protocol) */ private initializeSearch; /** Execute search and wait for results */ private executeSearchAndGetResults; /** Close the Tell Me dialog */ private closeDialog; /** * Find the search control in the dialog controls hierarchy */ private findSearchControl; /** * Determine the type of search result based on caption and badges */ private determinePageType; } //# sourceMappingURL=search-service.d.ts.map