UNPKG

openai-assistants-mcp

Version:

OpenAI Assistants MCP Server - A Model Context Protocol server providing OpenAI Assistants API tools and resources. Features comprehensive assistant management, thread operations, message handling, and run execution with seamless stdio transport for Claud

54 lines 1.75 kB
/** * Base Prompt Handler - Abstract class for MCP prompt handlers * * This class provides the foundation for handling MCP prompts protocol requests. * Unlike tool handlers, prompt handlers deal with prompts/list and prompts/get methods. */ import { MCPError } from '../../types/index.js'; import { ValidationResult } from '../../validation/index.js'; /** * Interface for prompt handler execution context */ export interface PromptHandlerContext { requestId: string | number | null; } /** * Abstract base class for prompt handlers */ export declare abstract class BasePromptHandler { protected context: PromptHandlerContext; constructor(context: PromptHandlerContext); /** * Template method that orchestrates validation and execution */ handle(params: any): Promise<any>; /** * Abstract method: Validate input parameters */ abstract validate(params: any): ValidationResult; /** * Abstract method: Execute the prompt operation */ abstract execute(params: any): Promise<any>; /** * Get the method name this handler is responsible for */ abstract getMethodName(): string; /** * Centralized error logging */ protected logError(error: any, params: any): void; /** * Sanitize parameters for logging (remove sensitive data) */ protected sanitizeParamsForLogging(params: any): any; /** * Helper method to create validation errors */ protected createValidationError(message: string, paramName?: string): MCPError; /** * Helper method to create execution errors */ protected createExecutionError(message: string, originalError?: any): MCPError; } //# sourceMappingURL=base-prompt-handler.d.ts.map