{"record":{"id":"a0cb894d9bd9f40d","repo":"n8n-io/n8n","slug":"source-must-be-disk-or-langtracer","errorCode":null,"errorMessage":"--source must be \"disk\" or \"langtracer\"","messagePattern":"--source must be \"disk\" or \"langtracer\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/evaluations/cli/build-mcp-manifest.ts","lineNumber":207,"sourceCode":"\t\t\t\tresult.projectId = nextArg(argv, i, arg);\n\t\t\t\ti += 2;\n\t\t\t\tbreak;\n\t\t\tcase '--tier':\n\t\t\t\tresult.tier = nextArg(argv, i, arg);\n\t\t\t\ti += 2;\n\t\t\t\tbreak;\n\t\t\tcase '--workflow-dir':\n\t\t\t\tresult.workflowDir = nextArg(argv, i, arg);\n\t\t\t\ti += 2;\n\t\t\t\tbreak;\n\t\t\tcase '--build-cwd':\n\t\t\t\tresult.buildCwd = nextArg(argv, i, arg);\n\t\t\t\ti += 2;\n\t\t\t\tbreak;\n\t\t\tcase '--source': {\n\t\t\t\tconst value = nextArg(argv, i, arg);\n\t\t\t\tif (value !== 'disk' && value !== 'langtracer') {\n\t\t\t\t\tthrow new Error('--source must be \"disk\" or \"langtracer\"');\n\t\t\t\t}\n\t\t\t\tresult.source = value;\n\t\t\t\ti += 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase '--suite':\n\t\t\t\tresult.suite = nextArg(argv, i, arg);\n\t\t\t\ti += 2;\n\t\t\t\tbreak;\n\t\t\tcase '-h':\n\t\t\tcase '--help':\n\t\t\t\treturn { helpRequested: true };\n\t\t\tdefault:\n\t\t\t\tif (arg.startsWith('--')) {\n\t\t\t\t\tthrow new Error(`Unknown flag: ${arg.split('=', 1)[0]} (use --help)`);\n\t\t\t\t}\n\t\t\t\tresult.slugs.push(arg);\n\t\t\t\ti += 1;","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/evaluations/cli/build-mcp-manifest.ts#L189-L225","documentation":"Thrown by parseArgs() in build-mcp-manifest.ts:207 when the value passed to --source is neither 'disk' nor 'langtracer'. The --source flag selects the test-case source: 'disk' (default) reads JSON files from --workflow-dir (or the n8n repo's evaluations/data/workflows/), 'langtracer' pulls a suite over MCP. Any other value is rejected because no provider exists for it.","triggerScenarios":"Passing `--source <anything-other-than-disk-or-langtracer>` to build-mcp-manifest, e.g. --source github, --source db, or a typo like --source dik. The check fires inside the --source case immediately after reading the value via nextArg().","commonSituations":"A typo in the source name, or a developer assuming a source type (e.g. 'api', 'remote') that this tool does not support. The valid set mirrors the eval CLI's Zod enum (z.enum(['disk','langtracer'])).","solutions":["Use --source disk (read test-case JSON from --workflow-dir or the repo default).","Use --source langtracer (pull a suite over MCP; requires --suite and LANGTRACER_URL/LANGTRACER_API_KEY).","Remove --source entirely to accept the default (disk).","Correct the typo."],"exampleFix":"// before\npnpm eval:build-mcp-manifest --source dik\n// after\npnpm eval:build-mcp-manifest --source disk","handlingStrategy":"validation","validationCode":"const VALID_SOURCES = new Set(['disk', 'langtracer']);\nfunction validateSource(args: string[]): void {\n  const idx = args.indexOf('--source');\n  if (idx !== -1 && !VALID_SOURCES.has(args[idx + 1])) {\n    throw new Error(`--source must be 'disk' or 'langtracer', got: ${args[idx + 1]}`);\n  }\n}","typeGuard":"function isValidSource(v: string): v is 'disk' | 'langtracer' {\n  return v === 'disk' || v === 'langtracer';\n}","tryCatchPattern":null,"preventionTips":["Remember the only valid sources are disk (files) and langtracer (MCP suite).","Omit --source to accept the default (disk).","Keep source and suite flags together in langtracer templates."],"tags":["cli","argument-validation","instance-ai","mcp-manifest"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}