/**
 * MCP Server mode base — evaluation methodology for MCP server tool-use testing.
 *
 * Defines rubric templates and scoring for evaluating how well an LLM can
 * discover and use MCP server tools correctly.
 *
 * @see docs/modes.md
 */
export function createMcpServerModeBase() {
    return {
        mode: {
            id: "mcp-server",
            label: "MCP Server Testing",
            validProviderPatterns: ["^mcp:", "^file://"],
            rubricTemplateIds: [
                "mcp-input-validation",
                "mcp-output-correctness",
                "mcp-error-handling",
            ],
            handlerModule: "./mode-handlers/mcp-server/index.js",
        },
        rubricTemplates: [
            {
                id: "mcp-input-validation",
                dimension: "mcp-input-validation",
                header: "Score MCP input validation from 0 to 100:",
                scale: [
                    "0: Tool called with completely wrong parameters",
                    "30: Some parameters correct but critical ones missing or wrong",
                    "50: Parameters mostly correct but types or formats are off",
                    "80: All required parameters correct, minor optional parameter issues",
                    "100: Perfect tool invocation with all parameters correctly formed",
                ],
                criteriaLabel: "Check for:",
            },
            {
                id: "mcp-output-correctness",
                dimension: "mcp-output-correctness",
                header: "Score MCP output correctness from 0 to 100:",
                scale: [
                    "0: Output is completely wrong or tool returned an error",
                    "30: Output partially correct but missing key data",
                    "50: Output correct but incomplete or improperly formatted",
                    "80: Output correct and well-formatted, minor issues",
                    "100: Output is correct, complete, and properly formatted",
                ],
                criteriaLabel: "Check for:",
            },
            {
                id: "mcp-error-handling",
                dimension: "mcp-error-handling",
                header: "Score MCP error handling from 0 to 100:",
                scale: [
                    "0: No error handling — crashes or returns garbage on bad input",
                    "30: Basic error detection but poor recovery or messaging",
                    "50: Errors detected and reported but not gracefully handled",
                    "80: Good error handling with clear messages and appropriate fallbacks",
                    "100: Excellent error handling — validates input, provides actionable errors, degrades gracefully",
                ],
            },
        ],
        scoringProfiles: {
            default: {
                "mcp-input-validation": 0.4,
                "mcp-output-correctness": 0.4,
                "mcp-error-handling": 0.2,
            },
        },
    };
}
