{"record":{"id":"18d76f6b43d08901","repo":"eyaltoledano/claude-task-master","slug":"missing-argument-18d76f","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/update-tasks.js","lineNumber":41,"sourceCode":" * @param {string} args.tag - Tag for the task (optional)\n * @param {Object} log - Logger object.\n * @param {Object} context - Context object containing session data.\n * @returns {Promise<Object>} - Result object with success status and data/error information.\n */\nexport async function updateTasksDirect(args, log, context = {}) {\n\tconst { session } = context;\n\tconst { from, prompt, research, tasksJsonPath, projectRoot, tag } = args;\n\n\t// Create the standard logger wrapper\n\tconst logWrapper = createLogWrapper(log);\n\n\t// --- Input Validation ---\n\tif (!projectRoot) {\n\t\tlogWrapper.error('updateTasksDirect 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\tif (!from) {\n\t\tlogWrapper.error('updateTasksDirect called without from ID');\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\tcode: 'MISSING_ARGUMENT',\n\t\t\t\tmessage: 'Starting task ID (from) is required'\n\t\t\t}\n\t\t};\n\t}\n\n\tif (!prompt) {\n\t\tlogWrapper.error('updateTasksDirect called without prompt');","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/update-tasks.js#L23-L59","documentation":"updateTasksDirect (bulk update-task tool) requires projectRoot because it is used for env/MCP context and path resolution. When args.projectRoot is falsy the call is rejected immediately with code MISSING_ARGUMENT before any core work happens.","triggerScenarios":"Calling the update_tasks MCP tool without projectRoot, or with projectRoot: '' / null / undefined in args.","commonSituations":"MCP client omitting projectRoot because the tool schema marks it optional; calling the direct function from custom scripts; running the server outside any project directory so no default root is injected.","solutions":["Pass the absolute project root: { from: '5', prompt: 'x', projectRoot: '/abs/path/to/project' }","Configure the MCP client to send projectRoot (it is derived from the workspace root in normal MCP usage)","Check that your client version populates projectRoot; upgrade the task-master MCP server/client pair if it never sends it"],"exampleFix":"// before\nawait updateTasksDirect({ from: '5', prompt: 'Add tests' }, log);\n// after\nawait updateTasksDirect({ from: '5', prompt: 'Add tests', projectRoot: '/home/me/myproject' }, log);","handlingStrategy":"validation","validationCode":"function assertProjectRoot(args) {\n  if (!args.projectRoot || typeof args.projectRoot !== 'string') {\n    throw new Error('projectRoot is required.');\n  }\n}","typeGuard":"function hasProjectRoot(a) {\n  return typeof a === 'object' && a !== null && typeof a.projectRoot === 'string' && a.projectRoot.length > 0;\n}","tryCatchPattern":"if (!hasProjectRoot(args)) {\n  console.error('Pass projectRoot (absolute path to repo root)');\n  return;\n}\nconst result = await updateTasksDirect(args, log);\nif (!result.success && result.error.code === 'MISSING_ARGUMENT') console.error(result.error.message);","preventionTips":["Always include projectRoot in update_tasks tool calls","Configure the MCP client to forward the workspace root","Check server/client version compatibility if projectRoot is never populated"],"tags":["validation","mcp","missing-argument"],"backgroundTag":"missing-required-parameter","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}