Telerik.Documents.AI.Tools.Core Provides a base class for defining agent tools that can be automatically discovered and exposed as AITool instances. Initializes a new instance of the AgentToolBase class. Executes the tool logic with license validation. This is the required pattern for all tool implementations. License validation is performed before executing the tool logic, unless already validated via GetTools wrapper. The tool logic to execute after license validation. A with the tool result or license error. Gets all tools as AITool instances, automatically discovering wrapper methods. License validation is performed on every tool invocation. Wrapper AIFunction that validates license before invoking the original function. Legacy tool result structure. For new code, use strongly-typed results from Messages.Tools namespace. Gets or sets a value indicating whether the tool execution encountered an error. Gets or sets the result message. Can contain plain text, JSON, SVG, or other content. For new code, use StructuredResult instead. Defines the supported document formats for import/export operations. Excel Open XML Spreadsheet format (.xlsx). Comma-Separated Values format (.csv). Excel 97-2003 format (.xls). Excel macro-enabled workbook file format (.xlsm). Word Open XML Document format (.docx). Word 97-2003 format (.doc). Rich Text Format (.rtf). HyperText Markup Language (.html). Markdown format (.md). Plain text format (.txt). Portable Document Format (.pdf). Portable Network Graphics image format (.png). Contains metadata about a document managed by a document repository. Gets or sets the unique identifier for the document. Gets or sets the display name of the document. Gets or sets the format of the document. Configuration options for document processing repositories. Gets or sets the timeout for document import operations. Set to null to allow unlimited time (not recommended for production). For security against DDoS attacks, explicitly choose a reasonable timeout value. Provides a registry for associating document types with their corresponding document repositories. Registers the specified document repository for the given document type. The type of document for which the repository is being registered. The repository instance to associate with the specified document type. Cannot be null. Thrown if is null. Attempts to retrieve the repository associated with the specified document type. This method does not throw an exception if the repository is not found. Use the returned Boolean value to determine whether the repository was successfully retrieved. The type of document for which to retrieve the repository. When this method returns, contains the repository associated with the specified document type, if found; otherwise, . This parameter is passed uninitialized. if a repository for the specified document type was found; otherwise, . Specifies the type of Document Processing document. Represents a collection of worksheets and related data within a spreadsheet file. The main document class of the Telerik SpreadProcessing library. Represents a flow content document that supports rich formatting, layout, and editing features. The main document class of the Telerik WordsProcessing library. Represents a fixed-layout document that can be paginated and viewed, typically used for print-ready content or precise document rendering. The main document class of the Telerik PdfProcessing library. Describes a document file with its path and format for processing operations Gets or sets the path to the document file to be processed. Gets or sets the format of the document file. Supported formats include Word (DOC, DOCX, RTF, HTML, MD, TXT), Spreadsheet (XLS, XLSX, CSV, TXT), and PDF. The selected format determines how the document is processed and saved. Provides document lifecycle management tools for creating, listing, and exporting documents. Defines a contract for managing, importing, exporting, and retrieving documents of a specific type within a repository. Gets the type of the document represented by this instance. Gets a value indicating whether this repository supports creating new documents. Single-document repositories typically return false. Gets a value indicating whether this repository supports managing multiple documents. Single-document repositories return false. Lists all documents currently managed by this repository. Collection of document metadata. Exports a document to a byte array in the specified format. The document identifier to export. If null, exports the default/current document. The target format for export. The stream to which the document will be exported. The document content as a byte array. Thrown when the specified format is not supported. Thrown when the specified document ID does not exist. Imports a document from a byte array and adds it to the repository. The document content as a byte array. The format of the document being imported. Optional name for the imported document. The document ID assigned to the imported document. Thrown when the repository does not support creation or the format is not supported. Gets a document by its identifier. The document identifier. If null, returns the default/current document. In single-document mode, this parameter is ignored. The requested document instance. Thrown when the specified document ID does not exist. Thrown when no documents are available and documentId is null. Creates a document using the specified document identifier and arguments. The unique identifier for the document to be created. Cannot be null or empty. An array of arguments used to populate or configure the document. Cannot be null. A string containing the contents of the created document. Merges the specified source documents and exports the combined result to the provided stream in the specified format. An array of identifiers for the source documents to merge. The order of identifiers determines the order in which documents are merged. Cannot be null or empty. The stream to which the merged document will be written. Must be writable and remain open for the duration of the operation. The format in which to export the merged document. Removes a document from the repository. The identifier of the document to remove. True if the document was removed; false if not found. Removes all documents from the repository. Provides a unified interface for managing documents of a specific type. Implementations can support single-document or multi-document scenarios. The type of document managed by this repository. Gets a document by its identifier. The document identifier. If null, returns the default/current document. In single-document mode, this parameter is ignored. The requested document instance. Thrown when the specified document ID does not exist. Thrown when no documents are available and documentId is null. Base class for in-memory document repositories that manage multiple documents. Provides common functionality for document storage, ID management, and metadata tracking. The type of document managed by this repository. Storage for documents keyed by document ID. Storage for document metadata keyed by document ID. The ID of the currently active document. The timeout for import operations, or null for no timeout. Initializes a new instance with no documents. Timeout for import operations, or null to allow unlimited time. Gets the document type managed by this repository. Gets the default format for documents created by this repository. Gets the default base name for newly created documents. Gets a document by its ID, or the current document if no ID is specified. The document ID, or null to get the current document. The requested document. No document ID specified and no current document is set. The specified document ID was not found. Resolves and validates a document ID according to Option 3 rules: - If null/empty, generates a unique ID using the provided base name - If provided and already exists, throws ArgumentException - If provided and unique, returns it as-is The document ID to validate, or null/empty for auto-generation. The base name to use when generating a new ID. The parameter name for exception messages. The validated or generated document ID. Stores a document and its metadata in the repository. The document ID. The document to store. The display name for the document. The document format. Generates a unique document ID, appending a numeric suffix if needed. The base name for the ID. A unique document ID. Removes a document from the repository. The identifier of the document to remove. True if the document was removed; false if not found. Removes all documents from the repository. Defines a contract for exporting documents to PDF format. Exports the specified document to PDF format and writes the result to the provided stream. The unique identifier of the document to export. Cannot be null or empty. The stream to which the generated PDF will be written. Must be writable and remain open for the duration of the operation. Represents errors that occur during license validation for Telerik Document Processing libraries. Initializes a new instance of the class with a specified error message. The message that describes the license validation error. Initializes a new instance of the class with a specified error message. The message that describes the license validation error. The log content providing details about the license validation process. Gets the log content as a string, providing a record of events or messages generated by the application. The log is updated in real-time and can be used for monitoring application behavior or debugging purposes. Validates the Telerik license during tool initialization. Logs a warning if license is invalid but does not throw. Validates the Telerik license before tool execution and returns the result. Returns null if valid, or a CallToolResult error if invalid. Provides validation utilities for output file paths. Ensures compliance with file system restrictions and application-specific requirements. Validates that a destination file path is within the allowed output directory and that the directory exists. Returns the full file path if validation passes. The file path to validate The allowed output directory that the file must be within The full file path if valid Represents a rectangular range in a worksheet defined by starting and ending row and column indices. Gets or sets the zero-based index of the first row in the range. Gets or sets the zero-based index of the starting column in the range. Gets or sets the zero-based index of the last row in the range, inclusive. Gets or sets the zero-based, inclusive index of the ending column in the range. Marks a method as a tool that can be exposed to AI agents. Use with [Description] attribute to provide tool documentation. Optional custom name for the tool. If not specified, method name is used. Whether this tool is enabled. Disabled tools are not registered. Shared helpers for building standard MCP tool results with consistent success/error signaling and optional structured payloads.