{"record":{"id":"0f715c7ec07729b3","repo":"eyaltoledano/claude-task-master","slug":"missing-argument-0f715c","errorCode":"MISSING_ARGUMENT","errorMessage":"tasksJsonPath is required","messagePattern":"tasksJsonPath is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/analyze-task-complexity.js","lineNumber":56,"sourceCode":"\t\tprojectRoot,\n\t\tids,\n\t\tfrom,\n\t\tto,\n\t\ttag\n\t} = args;\n\n\tconst logWrapper = createLogWrapper(log);\n\n\t// --- Initial Checks (remain the same) ---\n\ttry {\n\t\tlog.info(`Analyzing task complexity with args: ${JSON.stringify(args)}`);\n\n\t\tif (!tasksJsonPath) {\n\t\t\tlog.error('analyzeTaskComplexityDirect called without tasksJsonPath');\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'MISSING_ARGUMENT',\n\t\t\t\t\tmessage: 'tasksJsonPath is required'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tif (!outputPath) {\n\t\t\tlog.error('analyzeTaskComplexityDirect called without outputPath');\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: 'MISSING_ARGUMENT', message: 'outputPath is required' }\n\t\t\t};\n\t\t}\n\n\t\tconst tasksPath = tasksJsonPath;\n\t\tconst resolvedOutputPath = outputPath;\n\n\t\tlog.info(`Analyzing task complexity from: ${tasksPath}`);\n\t\tlog.info(`Output report will be saved to: ${resolvedOutputPath}`);\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/analyze-task-complexity.js#L38-L74","documentation":"analyzeTaskComplexityDirect needs tasksJsonPath to know which task list to analyze; the guard at the top returns MISSING_ARGUMENT when it is absent. Without the path the complexity analysis has no input file.","triggerScenarios":"Calling the analyze_project_complexity MCP tool without tasksJsonPath or with an empty value.","commonSituations":"Tool schema drift between MCP client and server versions; scripts building tool arguments dynamically and omitting the path; wrong environment where the tasks file path was never configured.","solutions":["Pass the absolute path to .taskmaster/tasks.json as tasksJsonPath","Re-sync the MCP client tool schema after upgrading task-master","Confirm the tasks file exists at the path you pass (path errors surface separately, but the argument must be present)"],"exampleFix":"// before\nanalyze_project_complexity({});\n// after\nanalyze_project_complexity({ tasksJsonPath: '/project/.taskmaster/tasks.json' });","handlingStrategy":"validation","validationCode":"if (!args?.tasksJsonPath || typeof args.tasksJsonPath !== 'string') {\n  throw new Error('analyze_project_complexity requires a non-empty tasksJsonPath');\n}","typeGuard":"function hasTasksJsonPath(a) {\n  return typeof a === 'object' && a !== null && typeof a.tasksJsonPath === 'string' && a.tasksJsonPath.length > 0;\n}","tryCatchPattern":"const res = await analyzeTaskComplexityDirect(args);\nif (!res.success && res.error?.code === 'MISSING_ARGUMENT' && /tasksJsonPath/.test(res.error.message)) {\n  // supply path and retry\n}","preventionTips":["Build tool args from a single validated config object","Check required fields against the tool schema before each call","Default tasksJsonPath to <root>/.taskmaster/tasks.json in wrappers"],"tags":["mcp","argument-validation","configuration"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}