{"record":{"id":"eeb52496cfa0b06e","repo":"eyaltoledano/claude-task-master","slug":"missing-argument-eeb524","errorCode":"MISSING_ARGUMENT","errorMessage":"projectRoot is required.","messagePattern":"projectRoot is required\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/parse-prd.js","lineNumber":57,"sourceCode":"\t\toutput: outputArg,\n\t\tnumTasks: numTasksArg,\n\t\tforce,\n\t\tappend,\n\t\tresearch,\n\t\tprojectRoot,\n\t\ttag\n\t} = args;\n\n\t// Create the standard logger wrapper\n\tconst logWrapper = createLogWrapper(log);\n\n\t// --- Input Validation and Path Resolution ---\n\tif (!projectRoot) {\n\t\tlogWrapper.error('parsePRDDirect requires a projectRoot argument.');\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\tcode: 'MISSING_ARGUMENT',\n\t\t\t\tmessage: 'projectRoot is required.'\n\t\t\t}\n\t\t};\n\t}\n\n\t// Resolve input path using path utilities\n\tlet inputPath;\n\tif (inputArg) {\n\t\ttry {\n\t\t\tinputPath = resolvePrdPath({ input: inputArg, projectRoot }, session);\n\t\t} catch (error) {\n\t\t\tlogWrapper.error(`Error resolving PRD path: ${error.message}`);\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: 'FILE_NOT_FOUND', message: error.message }\n\t\t\t};\n\t\t}\n\t} else {","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/parse-prd.js#L39-L75","documentation":"parsePRDDirect requires a `projectRoot` argument and rejects the call up front when it is falsy (parse-prd.js:52-61). projectRoot anchors all path resolution — PRD input, output tasks.json, and config defaults — so without it the function cannot resolve any filesystem paths safely.","triggerScenarios":"Calling the MCP `parse_prd` tool without `projectRoot` in args, or with an empty-string projectRoot; calling parsePRDDirect directly from code and forgetting the argument.","commonSituations":"Custom MCP clients or agents constructing tool arguments manually and omitting projectRoot; callers that assumed the server would infer the root from the session/cwd but called the direct function directly, which does no inference.","solutions":["Pass the absolute path to your project root as `projectRoot`.","If you are the tool caller, ensure the MCP client forwards projectRoot (it is a required arg for parse_prd).","If root is dynamic, resolve it before the call (e.g. process.cwd() or the directory containing .taskmaster/)."],"exampleFix":"// before\nawait parsePRDDirect({ input: './docs/prd.txt' }, log);\n\n// after\nawait parsePRDDirect({ input: './docs/prd.txt', projectRoot: '/abs/path/to/project' }, log);","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nif (!args?.projectRoot) throw new Error('projectRoot is required');\nif (!fs.existsSync(args.projectRoot)) throw new Error(`projectRoot does not exist: ${args.projectRoot}`);","typeGuard":"function hasProjectRoot(args) {\n  return typeof args === 'object' && args !== null && typeof args.projectRoot === 'string' && args.projectRoot.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Always include projectRoot in parse_prd tool arguments.","Use an absolute path resolved via path.resolve before the call.","In agents/MCP clients, default projectRoot to the workspace root or process.cwd().","Confirm the directory contains .taskmaster/ or will host it."],"tags":["mcp","missing-argument","input-validation","project-root"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}