UNPKG

@ignitionai/azure-ai-search-mcp

Version:

Complete Azure AI Search MCP server with vector search, semantic search, and document management

138 lines (137 loc) 4.33 kB
import type { AzureSearchConfig, SearchResult, DocumentResult, SuggestResult, AutocompleteResult, IndexResult, BatchResult, VectorSearchResult, SemanticSearchResult, VectorQuery } from "../types.js"; export declare class AzureSearchTools { private indexClient; private searchClients; private config; /** * Removes vector fields from search results to avoid returning large vector arrays * @param results Array of search results * @returns Filtered results without vector fields */ private removeVectorFields; /** * Recursively removes vector fields from an object * @param obj Object to filter */ private filterVectorFieldsRecursive; /** * Determines if a field is a vector field that should be removed * @param key Field name * @param value Field value * @returns True if field should be removed */ private isVectorField; constructor(config?: Partial<AzureSearchConfig>); private getIndexClient; private getSearchClient; searchDocuments(params: { indexName: string; searchText: string; searchMode?: "any" | "all"; searchFields?: string[]; select?: string[]; filter?: string; orderBy?: string[]; top?: number; skip?: number; includeTotalCount?: boolean; facets?: string[]; highlightFields?: string[]; highlightPreTag?: string; highlightPostTag?: string; minimumCoverage?: number; queryType?: "simple" | "full"; }): Promise<SearchResult>; getDocument(params: { indexName: string; key: string; select?: string[]; }): Promise<DocumentResult>; suggest(params: { indexName: string; searchText: string; suggesterName: string; fuzzy?: boolean; highlightPreTag?: string; highlightPostTag?: string; minimumCoverage?: number; orderBy?: string[]; searchFields?: string[]; select?: string[]; top?: number; filter?: string; }): Promise<SuggestResult>; autocomplete(params: { indexName: string; searchText: string; suggesterName: string; autocompleteMode?: "oneTerm" | "twoTerms" | "oneTermWithContext"; fuzzy?: boolean; highlightPreTag?: string; highlightPostTag?: string; minimumCoverage?: number; searchFields?: string[]; top?: number; filter?: string; }): Promise<AutocompleteResult>; listIndexes(params?: { select?: string[]; }): Promise<IndexResult>; getIndex(indexName: string): Promise<IndexResult>; getIndexStatistics(indexName: string): Promise<IndexResult>; uploadDocuments(params: { indexName: string; documents: any[]; }): Promise<BatchResult>; mergeDocuments(params: { indexName: string; documents: any[]; }): Promise<BatchResult>; deleteDocuments(params: { indexName: string; keyField: string; keyValues: string[]; }): Promise<BatchResult>; vectorSearch(params: { indexName: string; vectorQueries: VectorQuery[]; select?: string[]; filter?: string; top?: number; skip?: number; }): Promise<VectorSearchResult>; hybridSearch(params: { indexName: string; searchText: string; vectorQueries: VectorQuery[]; searchMode?: "any" | "all"; searchFields?: string[]; select?: string[]; filter?: string; orderBy?: string[]; top?: number; skip?: number; queryType?: "simple" | "full"; }): Promise<SearchResult>; semanticSearch(params: { indexName: string; searchText: string; semanticConfiguration: string; searchFields?: string[]; select?: string[]; filter?: string; orderBy?: string[]; top?: number; skip?: number; answers?: { answerType: "extractive"; count?: number; threshold?: number; }; captions?: { captionType: "extractive"; maxTextRecordsToProcess?: number; highlight?: boolean; }; }): Promise<SemanticSearchResult>; }