{"record":{"id":"0b0b4dfec6e98535","repo":"eyaltoledano/claude-task-master","slug":"missing-target-tag","errorCode":"MISSING_TARGET_TAG","errorMessage":"Target tag is required for cross-tag moves","messagePattern":"Target tag is required for cross-tag moves","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/move-task-cross-tag.js","lineNumber":59,"sourceCode":"\t\t};\n\t}\n\n\tif (!args.sourceTag) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\tmessage: 'Source tag is required for cross-tag moves',\n\t\t\t\tcode: 'MISSING_SOURCE_TAG'\n\t\t\t}\n\t\t};\n\t}\n\n\tif (!args.targetTag) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\tmessage: 'Target tag is required for cross-tag moves',\n\t\t\t\tcode: 'MISSING_TARGET_TAG'\n\t\t\t}\n\t\t};\n\t}\n\n\t// Validate that source and target tags are different\n\tif (args.sourceTag === args.targetTag) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\tmessage: `Source and target tags are the same (\"${args.sourceTag}\")`,\n\t\t\t\tcode: 'SAME_SOURCE_TARGET_TAG',\n\t\t\t\tsuggestions: [\n\t\t\t\t\t'Use different tags for cross-tag moves',\n\t\t\t\t\t'Use within-tag move: task-master move --from=<id> --to=<id> --tag=<tag>',\n\t\t\t\t\t'Check available tags: task-master tags'\n\t\t\t\t]\n\t\t\t}\n\t\t};","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/move-task-cross-tag.js#L41-L77","documentation":"MISSING_TARGET_TAG is a validation error from moveTaskCrossTagDirect when the `targetTag` argument is absent/falsy. The function needs a destination tag to move the task into. Returned as a structured success:false response.","triggerScenarios":"Invoking the move-task tool with sourceIds and sourceTag but no targetTag — e.g. { sourceIds: '5', sourceTag: 'backlog' } — triggers the guard at move-task-cross-tag.js:59.","commonSituations":"Callers assume the tool defaults to a 'done' or active tag; truncated tool arguments from an LLM; CLI invocations missing the --to-tag/--target-tag flag.","solutions":["Provide `targetTag` with the destination tag, e.g. targetTag: 'in-progress'.","Run `task-master tags` to confirm the destination tag exists (create it first if needed).","Ensure your CLI command passes the target tag flag."],"exampleFix":"// before\nawait moveTaskCrossTagDirect({ sourceIds: '5', sourceTag: 'backlog' }, log);\n// after\nawait moveTaskCrossTagDirect({ sourceIds: '5', sourceTag: 'backlog', targetTag: 'in-progress' }, log);","handlingStrategy":"validation","validationCode":"if (!args.targetTag) {\n  throw new Error('targetTag is required for cross-tag moves');\n}\nconst tags = execSync('task-master tags').toString();\nif (!tags.includes(args.targetTag)) {\n  throw new Error(`Unknown targetTag: ${args.targetTag}`);\n}","typeGuard":"function hasTargetTag(args) {\n  return typeof args?.targetTag === 'string' && args.targetTag.trim().length > 0;\n}","tryCatchPattern":"const resp = await moveTaskCrossTagDirect(args, log);\nif (!resp.success && resp.error.code === 'MISSING_TARGET_TAG') {\n  throw new Error('Add targetTag: the destination tag for the move');\n}","preventionTips":["Confirm the destination tag exists via `task-master tags` before moving.","Never assume a default target tag — always pass it explicitly.","For LLM callers, mark targetTag required in the tool input schema."],"tags":["mcp","validation","missing-parameter","tags","move-task"],"backgroundTag":"missing-required-parameter","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}