{"record":{"id":"0906a8c89b98ef3a","repo":"eyaltoledano/claude-task-master","slug":"missing-parameter-0906a8","errorCode":"MISSING_PARAMETER","errorMessage":"Either the prompt parameter or both title and description parameters are required for adding a task","messagePattern":"Either the prompt parameter or both title and description parameters are required for adding a task","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/add-task.js","lineNumber":80,"sourceCode":"\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 {\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:\n\t\t\t\t\t\t'Either the prompt parameter or both title and description parameters are required for adding a task'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t// Extract and prepare parameters\n\t\tconst taskDependencies = Array.isArray(dependencies)\n\t\t\t? dependencies // Already an array if passed directly\n\t\t\t: dependencies // Check if dependencies exist and are a string\n\t\t\t\t? String(dependencies)\n\t\t\t\t\t\t.split(',')\n\t\t\t\t\t\t.map((id) => parseInt(id.trim(), 10)) // Split, trim, and parse\n\t\t\t\t: []; // Default to empty array if null/undefined\n\t\tconst taskPriority = priority || 'medium'; // Default priority\n\n\t\tlet manualTaskData = null;\n\t\tlet newTaskId;","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/add-task.js#L62-L98","documentation":"addTaskDirect can create a task either from a natural-language prompt (parsed by AI) or from explicit title and description. If neither a prompt nor both title and description are supplied, it returns MISSING_PARAMETER since there is no content for the new task.","triggerScenarios":"add_task called with only tasksJsonPath; or with title but no description (or vice versa); or with empty-string values for all three.","commonSituations":"Prompt templating that drops the prompt field; UI forms submitting incomplete title/description pairs; misunderstanding that title alone is insufficient.","solutions":["Provide a prompt parameter describing the task, OR provide both title and description","If using title/description, ensure both are non-empty strings","Check the calling template/workflow for empty interpolated values"],"exampleFix":"// before\nadd_task({ tasksJsonPath: path, title: 'Fix bug' });\n// after\nadd_task({ tasksJsonPath: path, title: 'Fix bug', description: 'Null check in parser causes crash on empty input' });","handlingStrategy":"validation","validationCode":"const { prompt, title, description } = args ?? {};\nconst hasPrompt = typeof prompt === 'string' && prompt.trim().length > 0;\nconst hasTitleDesc = typeof title === 'string' && title.trim().length > 0 &&\n                     typeof description === 'string' && description.trim().length > 0;\nif (!hasPrompt && !hasTitleDesc) {\n  throw new Error('Provide either a prompt or both title and description');\n}","typeGuard":"function canAddTask(a) {\n  const p = typeof a?.prompt === 'string' && a.prompt.trim() !== '';\n  const t = typeof a?.title === 'string' && a.title.trim() !== '';\n  const d = typeof a?.description === 'string' && a.description.trim() !== '';\n  return p || (t && d);\n}","tryCatchPattern":"const res = await addTaskDirect(args);\nif (!res.success && res.error?.code === 'MISSING_PARAMETER') {\n  // ask user for prompt or title+description, then retry\n}","preventionTips":["Treat title/description as an all-or-nothing pair","Never send empty strings for prompt/title/description","Validate with a union schema (prompt XOR title+description) before calling"],"tags":["mcp","argument-validation"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}