{"record":{"id":"0b50c380f71d14d0","repo":"eyaltoledano/claude-task-master","slug":"missing-argument-0b50c3","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/add-task.js","lineNumber":59,"sourceCode":"\t\ttag\n\t} = args;\n\tconst { session } = context; // Destructure session from 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('addTaskDirect 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\t// Use provided path\n\t\tconst tasksPath = tasksJsonPath;\n\n\t\t// Check if this is manual task creation or AI-driven task creation\n\t\tconst isManualCreation = args.title && args.description;\n\n\t\t// Check required parameters\n\t\tif (!args.prompt && !isManualCreation) {\n\t\t\tlog.error(\n\t\t\t\t'Missing required parameters: either prompt or title+description must be provided'\n\t\t\t);\n\t\t\tdisableSilentMode();\n\t\t\treturn {","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/add-task.js#L41-L77","documentation":"addTaskDirect requires tasksJsonPath to locate the tasks store; without it the function cannot read or write tasks. It returns a structured MISSING_ARGUMENT error instead of throwing, mirroring the guard used by other direct functions.","triggerScenarios":"Calling the add_task MCP tool without tasksJsonPath, with undefined, or with an empty string.","commonSituations":"MCP client schema mismatch after upgrading task-master; wrapper code dropping arguments; manual tool invocation missing the required field.","solutions":["Pass the absolute path to .taskmaster/tasks.json as tasksJsonPath","Refresh the MCP client's cached tool schema so the required argument is sent","Verify argument spelling in the tool call payload"],"exampleFix":"// before\nadd_task({ prompt: 'Add login' });\n// after\nadd_task({ tasksJsonPath: '/project/.taskmaster/tasks.json', prompt: 'Add login' });","handlingStrategy":"validation","validationCode":"const tasksJsonPath = args?.tasksJsonPath;\nif (!tasksJsonPath || typeof tasksJsonPath !== 'string') {\n  throw new Error('add_task requires a non-empty tasksJsonPath string');\n}","typeGuard":"function hasTasksJsonPath(a) {\n  return typeof a === 'object' && a !== null && typeof a.tasksJsonPath === 'string' && a.tasksJsonPath.length > 0;\n}","tryCatchPattern":"const res = await addTaskDirect(args);\nif (!res.success && res.error?.code === 'MISSING_ARGUMENT') {\n  // configure/collect tasksJsonPath and retry once\n}","preventionTips":["Centralize tasksJsonPath resolution in one config helper","Validate all required tool args before dispatch","Re-sync MCP client schemas after task-master upgrades"],"tags":["mcp","argument-validation","configuration"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}