{"record":{"id":"4b9cd003621866e5","repo":"eyaltoledano/claude-task-master","slug":"missing-argument-4b9cd0","errorCode":"MISSING_ARGUMENT","errorMessage":"tasksJsonPath is required but was not provided.","messagePattern":"tasksJsonPath is required but was not provided\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/update-subtask-by-id.js","lineNumber":48,"sourceCode":"\tconst { session } = context;\n\t// Destructure expected args, including projectRoot and metadata\n\tconst { tasksJsonPath, id, prompt, research, metadata, projectRoot, tag } =\n\t\targs;\n\n\tconst logWrapper = createLogWrapper(log);\n\n\ttry {\n\t\tlogWrapper.info(\n\t\t\t`Updating subtask by ID via direct function. ID: ${id}, ProjectRoot: ${projectRoot}`\n\t\t);\n\n\t\t// Check if tasksJsonPath was provided\n\t\tif (!tasksJsonPath) {\n\t\t\tconst errorMessage = 'tasksJsonPath is required but was not provided.';\n\t\t\tlogWrapper.error(errorMessage);\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: 'MISSING_ARGUMENT', message: errorMessage }\n\t\t\t};\n\t\t}\n\n\t\t// Basic validation - ID must be present\n\t\t// In API storage, subtask IDs like \"HAM-2611\" are valid (no dot required)\n\t\t// In file storage, subtask IDs must be in format \"parentId.subtaskId\"\n\t\t// The core function handles storage-specific validation\n\t\tif (!id || typeof id !== 'string' || !id.trim()) {\n\t\t\tconst errorMessage = 'Subtask ID cannot be empty.';\n\t\t\tlogWrapper.error(errorMessage);\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: 'INVALID_SUBTASK_ID', message: errorMessage }\n\t\t\t};\n\t\t}\n\n\t\t// At least prompt or metadata is required (validated in MCP tool layer)\n\t\tif (!prompt && !metadata) {","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/update-subtask-by-id.js#L30-L66","documentation":"updateSubtaskByIdDirect requires the filesystem path to tasks.json (`tasksJsonPath`) because file-based storage needs to know where the task data lives. When the argument is missing/empty it returns MISSING_ARGUMENT immediately without attempting any update. This guard exists because unlike API storage, the file provider cannot infer the path.","triggerScenarios":"Calling the update-subtask-by-id MCP tool with id/prompt but omitting tasksJsonPath, or passing an empty string; a client wrapper that filters out path arguments it considers secrets.","commonSituations":"Migrating from API-backed storage where tasksJsonPath was unnecessary; copying example calls from API-mode docs into file-mode setups; agents dropping the path because it looks like boilerplate.","solutions":["Pass the absolute path to your tasks file, e.g. /path/to/project/.taskmaster/tasks/tasks.json.","If using API/Supabase storage, ensure the tool/schema variant you call does not require tasksJsonPath, or supply a placeholder per your setup docs.","Check the tool registration in your MCP client so the tasksJsonPath argument is forwarded, not stripped."],"exampleFix":"// before\nawait updateSubtask({ id: '5.2', prompt: 'Add tests' });\n// after\nawait updateSubtask({ id: '5.2', prompt: 'Add tests', tasksJsonPath: '/proj/.taskmaster/tasks/tasks.json' });","handlingStrategy":"validation","validationCode":"if (typeof tasksJsonPath !== 'string' || !tasksJsonPath.trim()) {\n  throw new Error('tasksJsonPath is required (path to tasks.json)');\n}\nif (!fs.existsSync(tasksJsonPath)) throw new Error(`tasks.json not found: ${tasksJsonPath}`);","typeGuard":"function hasTasksPath(a) { return typeof a.tasksJsonPath === 'string' && a.tasksJsonPath.trim().length > 0; }","tryCatchPattern":null,"preventionTips":["Build a single config/helper that resolves the tasks.json path once per project","Never pass falsy values through generic argument builders — filter consciously","For API storage, use the appropriate tool variant that does not require the path"],"tags":["mcp","missing-argument","validation"],"backgroundTag":"missing-required-parameter","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}