@simonecoelhosfo/optimizely-mcp-server
Version:
Optimizely MCP Server for AI assistants with integrated CLI tools
57 lines • 2.23 kB
TypeScript
/**
* Tool Definition Types for Modular MCP Tools
* @description Common interfaces and types for individual tool modules
* @since 2025-08-04
* @author Tool Modularization Team
*/
export interface ToolDefinition {
/** Unique tool name matching MCP tool identifier */
name: string;
/** Async handler function for tool execution */
handler: (args: any) => Promise<any>;
/** Whether this tool requires cache to be initialized */
requiresCache?: boolean;
/** Whether this tool requires authentication */
requiresAuth?: boolean;
/** Tool category for organization */
category?: 'discovery' | 'analytics' | 'operations' | 'management' | 'system' | 'documentation';
/** Detailed description for documentation */
description?: string;
}
export interface ToolDependencies {
/** Database storage operations */
storage: {
query: (sql: string, params: any[]) => Promise<any[]>;
get: (sql: string, params: any[]) => Promise<any>;
run: (sql: string, params: any[]) => Promise<void>;
all?: (sql: string, params: any[]) => Promise<any[]>;
};
/** Logger instance */
logger: {
info: (message: string, context?: any) => void;
debug: (context: any, message: string) => void;
error: (context: any, message: string) => void;
warn: (message: string, context?: any) => void;
};
/** Error mapping utilities */
errorMapper: {
toMCPError: (error: any, context?: any) => any;
};
/** Optional: Entity router for complex operations */
entityRouter?: any;
/** Optional: Schema builder for entity creation */
schemaBuilder?: any;
/** Optional: Defaults manager for entity defaults */
defaultsManager?: any;
/** Optional: OpenAPI handler for documentation */
openAPIHandler?: any;
/** Optional: Configuration manager */
configManager?: any;
/** Optional: Cache manager reference */
cacheManager?: any;
/** Optional: API client for direct API calls */
apiClient?: any;
}
/** Factory function type for creating tools with dependencies */
export type ToolFactory = (deps: ToolDependencies) => ToolDefinition;
//# sourceMappingURL=ToolDefinition.d.ts.map