{"record":{"id":"b67a6b14bc65ffdb","repo":"eyaltoledano/claude-task-master","slug":"missing-argument-b67a6b","errorCode":"MISSING_ARGUMENT","errorMessage":"tasksJsonPath is required","messagePattern":"tasksJsonPath is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/copy-tag.js","lineNumber":46,"sourceCode":"\tconst { tasksJsonPath, sourceName, targetName, description, projectRoot } =\n\t\targs;\n\tconst { session } = context;\n\n\t// Enable silent mode to prevent console logs from interfering with JSON response\n\tenableSilentMode();\n\n\t// Create logger wrapper using the utility\n\tconst mcpLog = createLogWrapper(log);\n\n\ttry {\n\t\t// Check if tasksJsonPath was provided\n\t\tif (!tasksJsonPath) {\n\t\t\tlog.error('copyTagDirect called without tasksJsonPath');\n\t\t\tdisableSilentMode();\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// Check required parameters\n\t\tif (!sourceName || typeof sourceName !== 'string') {\n\t\t\tlog.error('Missing required parameter: sourceName');\n\t\t\tdisableSilentMode();\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'MISSING_PARAMETER',\n\t\t\t\t\tmessage: 'Source tag name is required and must be a string'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/copy-tag.js#L28-L64","documentation":"copyTagDirect wraps the tag-copy operation, which duplicates an entire tag's task list within a tasks.json file. It requires tasksJsonPath to know which tasks file to operate on; without it there is no safe default, so it returns MISSING_ARGUMENT immediately and disables silent mode.","triggerScenarios":"Calling the copy-tag MCP tool without tasksJsonPath in the arguments; destructured args where the client omitted the path; custom tool registration that doesn't forward the parameter.","commonSituations":"MCP clients relying on a default .taskmaster/tasks.json that the tool doesn't apply; refactored callers that renamed the parameter; missing projectRoot causing the resolved path to be dropped.","solutions":["Pass tasksJsonPath explicitly, typically '.taskmaster/tasks.json' resolved against projectRoot","Ensure the MCP client sends the full argument object including tasksJsonPath","If path is derived, resolve it before calling (path.join(projectRoot, '.taskmaster/tasks.json')) and assert it is non-empty"],"exampleFix":"// before\nawait copyTagDirect({ sourceName: 'backlog', targetName: 'sprint-1' });\n// after\nawait copyTagDirect({ tasksJsonPath: path.join(projectRoot, '.taskmaster/tasks.json'), sourceName: 'backlog', targetName: 'sprint-1', projectRoot });","handlingStrategy":"validation","validationCode":"if (typeof tasksJsonPath !== 'string' || tasksJsonPath.trim() === '') throw new Error('tasksJsonPath is required');","typeGuard":"function hasTasksPath(a) { return typeof a === 'object' && a !== null && typeof a.tasksJsonPath === 'string' && a.tasksJsonPath.length > 0; }","tryCatchPattern":"const res = await copyTagDirect(args); if (!res.success && res.error.code === 'MISSING_ARGUMENT') { console.error(res.error.message); }","preventionTips":["Centralize the tasks.json path resolution in one helper","Include tasksJsonPath in the MCP client tool schema as required","Resolve the path against projectRoot rather than assuming cwd"],"tags":["mcp","argument-validation","tags"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}