{"record":{"id":"fd72358795a70ffa","repo":"eyaltoledano/claude-task-master","slug":"missing-argument-fd7235","errorCode":"MISSING_ARGUMENT","errorMessage":"tasksJsonPath is required but was not provided.","messagePattern":"tasksJsonPath is required but was not provided\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/set-task-status.js","lineNumber":40,"sourceCode":" * @param {Object} log - Logger object.\n * @param {Object} context - Additional context (session)\n * @returns {Promise<Object>} - Result object with success status and data/error information.\n */\nexport async function setTaskStatusDirect(args, log, context = {}) {\n\t// Destructure expected args, including the resolved tasksJsonPath and projectRoot\n\tconst { tasksJsonPath, id, status, complexityReportPath, projectRoot, tag } =\n\t\targs;\n\tconst { session } = context;\n\ttry {\n\t\tlog.info(`Setting task status with args: ${JSON.stringify(args)}`);\n\n\t\t// Check if tasksJsonPath was provided\n\t\tif (!tasksJsonPath) {\n\t\t\tconst errorMessage = 'tasksJsonPath is required but was not provided.';\n\t\t\tlog.error(errorMessage);\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: 'MISSING_ARGUMENT', message: errorMessage }\n\t\t\t};\n\t\t}\n\n\t\t// Check required parameters (id and status)\n\t\tif (!id) {\n\t\t\tconst errorMessage =\n\t\t\t\t'No task ID specified. Please provide a task ID to update.';\n\t\t\tlog.error(errorMessage);\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: 'MISSING_TASK_ID', message: errorMessage }\n\t\t\t};\n\t\t}\n\n\t\tif (!status) {\n\t\t\tconst errorMessage =\n\t\t\t\t'No status specified. Please provide a new status value.';\n\t\t\tlog.error(errorMessage);","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/set-task-status.js#L22-L58","documentation":"setTaskStatusDirect returns this error when the 'tasksJsonPath' argument is not provided. The tool must know where tasks.json lives to update a task's status, so it fails fast with code MISSING_ARGUMENT before checking id or status.","triggerScenarios":"Calling the set-task-status MCP tool without tasksJsonPath, with an empty string, or with the argument dropped during client-side argument serialization.","commonSituations":"MCP server launched outside the project directory so no default path was supplied; clients built before tasksJsonPath was a required argument (version/API change); typos in the argument name.","solutions":["Pass tasksJsonPath pointing to the project's tasks.json in the tool arguments","Initialize/verify the taskmaster project so tasks.json exists and its path is known","Check the MCP client config that supplies default tool arguments"],"exampleFix":"// before\nawait client.callTool('set-task-status', { id: '5', status: 'done' });\n// after\nawait client.callTool('set-task-status', { tasksJsonPath: '/app/.taskmaster/tasks.json', id: '5', status: 'done' });","handlingStrategy":"validation","validationCode":"if (!args?.tasksJsonPath) throw new Error('set-task-status requires tasksJsonPath');","typeGuard":"function hasTasksPath(args) { return typeof args?.tasksJsonPath === 'string' && args.tasksJsonPath.trim().length > 0; }","tryCatchPattern":"try { const r = await callTool('set-task-status', args); if (!r.success) throw new Error(`${r.error.code}: ${r.error.message}`); } catch (e) { if (e.message.includes('MISSING_ARGUMENT')) { /* supply tasksJsonPath and retry */ } else throw e; }","preventionTips":["Centralize the tasks.json path in one config module","Validate tool args against a required-field schema","Check MCP server cwd/config when errors appear after environment changes"],"tags":["mcp","validation","missing-argument"],"backgroundTag":"missing-required-parameter","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}