/** * Response Validator for MCP Tool Testing * Validates that tool responses are actually functional, not just present * * @internal * @module assessment/ResponseValidator */ import { CompatibilityCallToolResult, Tool } from "@modelcontextprotocol/sdk/types.js"; import { ResponseMetadata } from "../../lib/assessmentTypes.js"; export interface ValidationResult { isValid: boolean; isError: boolean; confidence: number; issues: string[]; evidence: string[]; classification: "fully_working" | "partially_working" | "connectivity_only" | "broken" | "error"; /** Metadata about response content types (optional, for enhanced tracking) */ responseMetadata?: ResponseMetadata; } export interface ValidationContext { tool: Tool; input: Record; response: CompatibilityCallToolResult; scenarioCategory?: "happy_path" | "edge_case" | "boundary" | "error_case"; } export declare class ResponseValidator { /** * Safely extract content array from response using Zod validation. * Falls back to undefined if content is not a valid array. */ private static safeGetContentArray; /** * Safely parse MCP tool call result using Zod validation. * Returns validated data or undefined if validation fails. */ private static safeGetMCPResponse; /** * Extract response metadata including content types, structuredContent, and _meta */ static extractResponseMetadata(context: ValidationContext): ResponseMetadata; /** * Validate a tool response comprehensively */ static validateResponse(context: ValidationContext): ValidationResult; /** * Check if error is a business logic error (not a tool failure) * These errors indicate the tool is working correctly but rejecting invalid business data */ static isBusinessLogicError(context: ValidationContext): boolean; /** * Calculate confidence score for a set of validation results */ static calculateOverallConfidence(results: ValidationResult[]): number; } //# sourceMappingURL=ResponseValidator.d.ts.map