n8n-io/n8n · error · Error

--source must be "disk" or "langtracer"

Error message

--source must be "disk" or "langtracer"

What it means

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.

Source

Thrown at packages/@n8n/instance-ai/evaluations/cli/build-mcp-manifest.ts:207

				result.projectId = nextArg(argv, i, arg);
				i += 2;
				break;
			case '--tier':
				result.tier = nextArg(argv, i, arg);
				i += 2;
				break;
			case '--workflow-dir':
				result.workflowDir = nextArg(argv, i, arg);
				i += 2;
				break;
			case '--build-cwd':
				result.buildCwd = nextArg(argv, i, arg);
				i += 2;
				break;
			case '--source': {
				const value = nextArg(argv, i, arg);
				if (value !== 'disk' && value !== 'langtracer') {
					throw new Error('--source must be "disk" or "langtracer"');
				}
				result.source = value;
				i += 2;
				break;
			}
			case '--suite':
				result.suite = nextArg(argv, i, arg);
				i += 2;
				break;
			case '-h':
			case '--help':
				return { helpRequested: true };
			default:
				if (arg.startsWith('--')) {
					throw new Error(`Unknown flag: ${arg.split('=', 1)[0]} (use --help)`);
				}
				result.slugs.push(arg);
				i += 1;

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Use --source disk (read test-case JSON from --workflow-dir or the repo default).
  2. Use --source langtracer (pull a suite over MCP; requires --suite and LANGTRACER_URL/LANGTRACER_API_KEY).
  3. Remove --source entirely to accept the default (disk).
  4. Correct the typo.

Example fix

// before
pnpm eval:build-mcp-manifest --source dik
// after
pnpm eval:build-mcp-manifest --source disk
Defensive patterns

Strategy: validation

Validate before calling

const VALID_SOURCES = new Set(['disk', 'langtracer']);
function validateSource(args: string[]): void {
  const idx = args.indexOf('--source');
  if (idx !== -1 && !VALID_SOURCES.has(args[idx + 1])) {
    throw new Error(`--source must be 'disk' or 'langtracer', got: ${args[idx + 1]}`);
  }
}

Type guard

function isValidSource(v: string): v is 'disk' | 'langtracer' {
  return v === 'disk' || v === 'langtracer';
}

Prevention

When it happens

Trigger: 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().

Common situations: 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'])).

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/a0cb894d9bd9f40d. Report an issue: GitHub.