{"record":{"id":"d49d09a14a1113f9","repo":"eyaltoledano/claude-task-master","slug":"missing-argument-d49d09","errorCode":"MISSING_ARGUMENT","errorMessage":"tasksJsonPath is required","messagePattern":"tasksJsonPath is required","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/remove-dependency.js","lineNumber":34,"sourceCode":" * @param {string|number} args.dependsOn - Task ID to remove as a dependency\n * @param {string} args.projectRoot - Project root path (for MCP/env fallback)\n * @param {string} args.tag - Tag for the task (optional)\n * @param {Object} log - Logger object\n * @returns {Promise<{success: boolean, data?: Object, error?: {code: string, message: string}}>}\n */\nexport async function removeDependencyDirect(args, log) {\n\t// Destructure expected args\n\tconst { tasksJsonPath, id, dependsOn, projectRoot, tag } = args;\n\ttry {\n\t\tlog.info(`Removing dependency with args: ${JSON.stringify(args)}`);\n\n\t\t// Check if tasksJsonPath was provided\n\t\tif (!tasksJsonPath) {\n\t\t\tlog.error('removeDependencyDirect 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\n\t\t// Validate required parameters\n\t\tif (!id) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'INPUT_VALIDATION_ERROR',\n\t\t\t\t\tmessage: 'Task ID (id) is required'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tif (!dependsOn) {\n\t\t\treturn {","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/remove-dependency.js#L16-L52","documentation":"MISSING_ARGUMENT with 'tasksJsonPath is required' is returned by removeDependencyDirect when the args object has no tasksJsonPath. This wrapper requires an explicit path to the tasks.json file and does not fall back to defaults. It is a guard returning a structured error object (success:false), not a thrown exception.","triggerScenarios":"Calling removeDependencyDirect(args, log) where args.tasksJsonPath is undefined, null, or an empty string — e.g. the MCP tool invocation omitted the tasksJsonPath parameter.","commonSituations":"MCP client invokes remove_dependency tool without passing tasksJsonPath; a tool config or client schema mismatch drops the parameter; caller assumed projectRoot alone would resolve the path.","solutions":["Pass an explicit absolute path to tasks.json in args.tasksJsonPath","Ensure the MCP tool call includes the tasksJsonPath parameter","Verify the client-side tool schema requires/forwards tasksJsonPath","If only projectRoot is known, resolve <projectRoot>/.taskmaster/tasks.json (or tagged variant) and pass that path"],"exampleFix":"// before\nawait removeDependencyDirect({ id: 5, dependsOn: 3, projectRoot }, log);\n// after\nawait removeDependencyDirect({ tasksJsonPath: '/proj/.taskmaster/tasks.json', id: 5, dependsOn: 3, projectRoot }, log);","handlingStrategy":"validation","validationCode":"if (!args || typeof args.tasksJsonPath !== 'string' || args.tasksJsonPath.trim() === '') {\n  throw new Error('tasksJsonPath must be a non-empty string');\n}","typeGuard":"function hasTasksJsonPath(args) {\n  return typeof args?.tasksJsonPath === 'string' && args.tasksJsonPath.length > 0;\n}","tryCatchPattern":"const result = await removeDependencyDirect(args, log);\nif (!result.success && result.error.code === 'MISSING_ARGUMENT') {\n  console.error('Missing argument:', result.error.message); // 'tasksJsonPath is required'\n}","preventionTips":["Always pass an explicit absolute tasksJsonPath when calling removeDependencyDirect","Build args objects from a shared helper that includes the resolved tasks.json path","Check result.success and result.error.code on every direct-function call","Resolve the path once per project (e.g. <projectRoot>/.taskmaster/tasks.json) and reuse it"],"tags":["mcp","validation","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}