{"record":{"id":"decf7eb9a9ee72e7","repo":"eyaltoledano/claude-task-master","slug":"missing-argument-decf7e","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/delete-tag.js","lineNumber":44,"sourceCode":"\t// Destructure expected args\n\tconst { tasksJsonPath, name, yes = false, projectRoot } = args;\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('deleteTagDirect 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 (!name || typeof name !== 'string') {\n\t\t\tlog.error('Missing required parameter: name');\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: 'Tag name is required and must be a string'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/delete-tag.js#L26-L62","documentation":"deleteTagDirect requires the filesystem path to the tasks JSON file (tasksJsonPath) to locate and modify tag data. When the argument is missing/empty it short-circuits with a structured MISSING_ARGUMENT error before doing any work. This is a guard against the MCP tool being invoked with an incomplete arguments object.","triggerScenarios":"Calling the delete_tag MCP tool with an arguments object lacking the tasksJsonPath field, or the tool registration/wiring failing to forward the resolved tasks path (e.g. custom server setup omitting PROJECT_PATH resolution).","commonSituations":"Hand-rolled MCP client requests omitting the parameter; a broken custom MCP server config where environment-based path resolution (TM_TASKS_FILE / project root detection) fails; copying example tool calls that predate the tasksJsonPath requirement.","solutions":["Pass tasksJsonPath explicitly, e.g. { tasksJsonPath: '/abs/path/.taskmaster/tasks.json' }.","Ensure the MCP server is launched with the correct project root so path auto-resolution populates the argument.","Confirm the .taskmaster/tasks.json file exists and pass its absolute path.","If using a wrapper, log the arguments object reaching deleteTagDirect to see which field is dropped."],"exampleFix":"// before\nawait deleteTagDirect({ name: 'old-tag' });\n// after\nawait deleteTagDirect({ tasksJsonPath: '/repo/.taskmaster/tasks.json', name: 'old-tag' });","handlingStrategy":"validation","validationCode":"function assertTasksJsonPath(args) {\n  if (typeof args.tasksJsonPath !== 'string' || !args.tasksJsonPath.trim()) {\n    throw new Error('tasksJsonPath is required');\n  }\n  return args.tasksJsonPath;\n}","typeGuard":"function hasTasksJsonPath(a) {\n  return typeof a === 'object' && a !== null &&\n    typeof a.tasksJsonPath === 'string' && a.tasksJsonPath.length > 0;\n}","tryCatchPattern":"if (!hasTasksJsonPath(args)) {\n  return { success: false, error: { code: 'MISSING_ARGUMENT', message: 'tasksJsonPath is required' } };\n}\nconst res = await deleteTagDirect(args);","preventionTips":["Centralize tasksJsonPath construction (resolve(projectRoot, '.taskmaster/tasks.json')) in one helper.","Validate the MCP server's project-root env at startup, not at first tool call.","Assert required argument presence in wrappers around direct functions.","Keep the default .taskmaster/tasks.json layout so path auto-resolution works."],"tags":["mcp-server","missing-argument","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}