import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { CommandRegistry } from './cliCommandTools.js'; import { CLICommand, CommandProcessor, CommandResult } from '../utils/types.js'; /** * Manager for handling MCP tools registration and execution */ export declare class ToolsManager { private commandRegistry; private mcpServer; private cliExecutor; private cliCmdWriter; /** * Create a new ToolsManager * @param mcpServer The MCP server instance */ constructor(mcpServer: McpServer); /** * Initialize all tools */ private initializeTools; /** * Register resource access tools for ServiceNow metadata */ private registerResourceTools; /** * Registers a command as an MCP tool * @param command The command to register */ private registerToolFromCommand; /** * Format the result of a command execution * @param result The command result * @returns Formatted string with the result */ formatResult(result: { success: boolean; output: string; exitCode?: number; error?: string; }): string; /** * Get a command by name * @param name The command name * @returns The command or undefined if not found */ getCommand(name: string): CLICommand | undefined; /** * Get all commands as MCP tools * @returns List of MCP tools */ getMCPTools(): Record[]; /** * Get the command registry * @returns The command registry */ getCommandRegistry(): CommandRegistry; /** * Update the roots in CLI tools * @param roots Array of root URIs and optional names */ updateRoots(roots: { uri: string; name?: string; }[]): void; /** * Get the shared CLI executor used by registered commands */ getExecutorProcessor(): CommandProcessor; /** * Execute the AuthCommand using the shared executor (not the writer) * Used internally by server for auto-auth validation at startup. * Note: AuthCommand is not exposed to MCP clients - authentication is managed * via environment variables (SN_INSTANCE_URL, SN_AUTH_TYPE) and the auth alias * is stored in session for use by all SDK commands. * Uses dynamic import to lazy-load AuthCommand only when needed. */ runAuth(args: Record): Promise; } //# sourceMappingURL=toolsManager.d.ts.map