{"record":{"id":"6bcba1baacf7196e","repo":"eyaltoledano/claude-task-master","slug":"input-validation-error-6bcba1","errorCode":"INPUT_VALIDATION_ERROR","errorMessage":"Task ID (id) is required","messagePattern":"Task ID \\(id\\) is required","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/remove-dependency.js","lineNumber":45,"sourceCode":"\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 {\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: 'Dependency ID (dependsOn) is required'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t// Use provided path\n\t\tconst tasksPath = tasksJsonPath;\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/remove-dependency.js#L27-L63","documentation":"INPUT_VALIDATION_ERROR with 'Task ID (id) is required' is returned when removeDependencyDirect is called without the id parameter identifying the task whose dependency should be removed. Like the other guards in this wrapper, it returns a structured error object rather than throwing. It fires before any file access or core call.","triggerScenarios":"Calling removeDependencyDirect(args, log) where args.id is undefined, null, or empty — tasksJsonPath and dependsOn may be present but id is missing (note: id=0 is also falsy and triggers this).","commonSituations":"MCP client omits the id parameter in the remove_dependency tool call; LLM tool-call arguments drop the field; a caller passes only dependsOn assuming the dependency owner is inferred.","solutions":["Include the numeric or dotted task id (e.g. 5 or '5.2') in args.id","Check the MCP tool invocation arguments include id","Avoid id values that coerce to falsy (0, '', null); use a valid positive task ID","Confirm the task exists in tasks.json and use its actual ID"],"exampleFix":"// before\nawait removeDependencyDirect({ tasksJsonPath, dependsOn: 3 }, log);\n// after\nawait removeDependencyDirect({ tasksJsonPath, id: 5, dependsOn: 3 }, log);","handlingStrategy":"validation","validationCode":"if (args?.id === undefined || args?.id === null || args?.id === '') {\n  throw new Error('id (task ID) is required before calling removeDependencyDirect');\n}","typeGuard":"function hasTaskId(args) {\n  return typeof args?.id === 'string' ? args.id.length > 0 : typeof args?.id === 'number' && args.id > 0;\n}","tryCatchPattern":"const result = await removeDependencyDirect(args, log);\nif (!result.success && result.error.message === 'Task ID (id) is required') {\n  console.error('Provide args.id, e.g. 5 or \"5.2\"');\n}","preventionTips":["Always include both id and dependsOn in remove_dependency tool calls","Validate tool arguments against the schema before invoking the direct function","Use positive, existing task IDs (id=0 is falsy and would trigger this guard)","Fetch the task first to confirm its ID before removing dependencies"],"tags":["mcp","validation","task-id"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}