{"record":{"id":"fef5d54e6f9a3a99","repo":"eyaltoledano/claude-task-master","slug":"same-source-target-tag","errorCode":"SAME_SOURCE_TARGET_TAG","errorMessage":"Source and target tags are the same (\"${args.sourceTag}\")","messagePattern":"Source and target tags are the same \\(\"(.+?)\"\\)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/move-task-cross-tag.js","lineNumber":70,"sourceCode":"\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};\n\t}\n\n\ttry {\n\t\t// Find tasks.json path if not provided\n\t\tlet tasksPath = args.tasksJsonPath || args.file;\n\t\tif (!tasksPath) {\n\t\t\tif (!args.projectRoot) {\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: {\n\t\t\t\t\t\tmessage:","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/move-task-cross-tag.js#L52-L88","documentation":"SAME_SOURCE_TARGET_TAG is a validation error raised when sourceTag and targetTag are identical. That would not be a cross-tag move, so the function rejects it and suggests using the within-tag move form instead. Includes actionable suggestions in the error payload.","triggerScenarios":"Calling moveTaskCrossTagDirect with sourceTag === targetTag — e.g. { sourceIds: '5', sourceTag: 'backlog', targetTag: 'backlog' } — triggers the check at move-task-cross-tag.js:70.","commonSituations":"Copy-paste of tag names into both fields, LLM clients echoing the same tag for both arguments, scripts computing tags dynamically that end up equal.","solutions":["Set targetTag to a tag different from sourceTag.","If you actually want to reorder/reposition within the same tag, use the within-tag move: task-master move --from=<id> --to=<id> --tag=<tag>.","Run `task-master tags` to confirm the intended destination tag name."],"exampleFix":"// before\nawait moveTaskCrossTagDirect({ sourceIds: '5', sourceTag: 'backlog', targetTag: 'backlog' }, log);\n// after\nawait moveTaskCrossTagDirect({ sourceIds: '5', sourceTag: 'backlog', targetTag: 'in-progress' }, log);","handlingStrategy":"validation","validationCode":"if (args.sourceTag && args.targetTag && args.sourceTag === args.targetTag) {\n  throw new Error('sourceTag and targetTag must differ; use within-tag move for reordering');\n}","typeGuard":"function isCrossTagMove(args) {\n  return typeof args?.sourceTag === 'string' && typeof args?.targetTag === 'string' && args.sourceTag !== args.targetTag;\n}","tryCatchPattern":"const resp = await moveTaskCrossTagDirect(args, log);\nif (!resp.success && resp.error.code === 'SAME_SOURCE_TARGET_TAG') {\n  // resp.error.suggestions lists the within-tag alternative\n  throw new Error(resp.error.suggestions.join(' | '));\n}","preventionTips":["Validate sourceTag !== targetTag in the calling code before invoking the tool.","Use `task-master move --from=<id> --to=<id> --tag=<tag>` when you intend a within-tag reorder.","Derive tag names from `task-master tags` output rather than hardcoding strings twice."],"tags":["mcp","validation","tags","move-task","invalid-arguments"],"backgroundTag":"identical-source-and-target","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}