{"record":{"id":"66a274cac22d02ee","repo":"eyaltoledano/claude-task-master","slug":"input-validation-error-66a274","errorCode":"INPUT_VALIDATION_ERROR","errorMessage":"Subtask ID is required and must be in format \"parentId.subtaskId\"","messagePattern":"Subtask ID is required and must be in format \"parentId\\.subtaskId\"","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/remove-subtask.js","lineNumber":50,"sourceCode":"\t\t// Check if tasksJsonPath was provided\n\t\tif (!tasksJsonPath) {\n\t\t\tlog.error('removeSubtaskDirect called without tasksJsonPath');\n\t\t\tdisableSilentMode(); // Disable before returning\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\tif (!id) {\n\t\t\tdisableSilentMode(); // Disable before returning\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:\n\t\t\t\t\t\t'Subtask ID is required and must be in format \"parentId.subtaskId\"'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t// Validate subtask ID format\n\t\tif (!id.includes('.')) {\n\t\t\tdisableSilentMode(); // Disable before returning\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: `Invalid subtask ID format: ${id}. Expected format: \"parentId.subtaskId\"`\n\t\t\t\t}\n\t\t\t};\n\t\t}\n","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/remove-subtask.js#L32-L68","documentation":"removeSubtaskDirect validates that an `id` argument is present before parsing it. If `id` is undefined/empty it returns INPUT_VALIDATION_ERROR, because a subtask can only be removed when identified as `parentId.subtaskId`. This guards the core removeSubtask from operating on nothing.","triggerScenarios":"Invoking the remove_subtask tool with no `id` argument, an empty string, or an args object where `id` was renamed or omitted (e.g. passing `subtaskId` or `taskId` instead).","commonSituations":"Client code mapping the wrong CLI flag to the tool args; LLM tool calls that omit the id parameter; templates that forgot to interpolate the id variable into the args object.","solutions":["Include `id` in the tool call args in `parentId.subtaskId` form (e.g. \"5.3\").","Check that the variable feeding args.id is actually populated (don't pass an un-interpolated template value).","If you meant to remove a whole task, use the remove_task tool instead of remove_subtask.","Log the full args object before the call to confirm the id survives your client-side mapping."],"exampleFix":"// before\nawait removeSubtaskDirect({ tasksJsonPath: path, id: undefined, log });\n// after\nawait removeSubtaskDirect({ tasksJsonPath: path, id: `${parentId}.${subtaskId}`, log });","handlingStrategy":"validation","validationCode":"function assertSubtaskId(args) {\n  if (typeof args?.id !== 'string' || args.id.trim() === '') {\n    throw new Error('id is required for remove_subtask, e.g. \"5.3\"');\n  }\n  return args.id.trim();\n}","typeGuard":"function hasSubtaskId(args) {\n  return typeof args?.id === 'string' && args.id.trim().length > 0;\n}","tryCatchPattern":"const result = await removeSubtaskDirect(args, log);\nif (!result.success && result.error?.code === 'INPUT_VALIDATION_ERROR' && !args.id) {\n  throw new Error('remove_subtask requires id in \"parentId.subtaskId\" form');\n}","preventionTips":["Check the id value is populated (not an un-interpolated template) before calling.","Use remove_task for top-level tasks; reserve remove_subtask for dotted ids.","Wrap direct-function calls in a small client helper that validates required args once.","Dump the args object in debug logs to catch silently dropped fields."],"tags":["mcp","validation","subtask-id","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}