UNPKG

@boundless-oss/atlas

Version:

Atlas - MCP Server for comprehensive startup project management

97 lines 2.62 kB
import { JSONSchema7 } from 'json-schema'; import { AtlasTool, RequestContext, ToolResult, ToolError, ToolRegistration } from './types.js'; /** * Tool Registry - manages all registered tools */ export declare class ToolRegistry { private tools; private modules; private validator; constructor(); /** * Register a module with its tools */ registerModule(registration: ToolRegistration): void; /** * Get a tool by name */ getTool(name: string): AtlasTool | undefined; /** * Get all registered tools */ getAllTools(): AtlasTool[]; /** * Get tools by module */ getToolsByModule(moduleName: string): AtlasTool[]; /** * Get all modules */ getModules(): string[]; /** * Get tool manifest for MCP */ getToolManifest(): Array<{ name: string; description: string; inputSchema: JSONSchema7; category?: string; readOnly?: boolean; }>; /** * Get tool count */ getToolCount(): number; /** * Get module count */ getModuleCount(): number; /** * Validate a tool definition */ private validateToolDefinition; } /** * Tool executor - handles tool execution with validation and error handling */ export declare class ToolExecutor { private registry; private validator; constructor(registry: ToolRegistry); /** * Execute a tool with validation and error handling */ execute(toolName: string, input: any, context: RequestContext): Promise<ToolResult>; /** * Create a standardized error result */ private createErrorResult; /** * Record tool execution metrics */ private recordExecution; } export declare function getToolRegistry(): ToolRegistry; export declare function getToolExecutor(): ToolExecutor; /** * Utility function to create a tool definition with common patterns */ export declare function createTool<TInput, TOutput>(config: { name: string; description: string; inputSchema: JSONSchema7; outputSchema?: JSONSchema7; category?: string; requiresApproval?: boolean; readOnly?: boolean; execute: (input: TInput, context: RequestContext) => Promise<ToolResult<TOutput>>; }): AtlasTool<TInput, TOutput>; /** * Utility to create success results */ export declare function createSuccessResult<T>(data: T, metadata?: any): ToolResult<T>; /** * Utility to create error results */ export declare function createErrorResult(error: Partial<ToolError>): ToolResult; //# sourceMappingURL=tool-framework.d.ts.map