{"record":{"id":"1cd62c0dc21f7561","repo":"eyaltoledano/claude-task-master","slug":"missing-task-id","errorCode":"MISSING_TASK_ID","errorMessage":"No task ID specified. Please provide a task ID to update.","messagePattern":"No task ID specified\\. Please provide a task ID to update\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/set-task-status.js","lineNumber":51,"sourceCode":"\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);\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: 'MISSING_STATUS', message: errorMessage }\n\t\t\t};\n\t\t}\n\n\t\t// Use the provided path\n\t\tconst tasksPath = tasksJsonPath;\n\n\t\t// Execute core setTaskStatus function\n\t\tconst taskId = id;","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/set-task-status.js#L33-L69","documentation":"setTaskStatusDirect returns this error when the 'id' argument is missing. Updating a status requires a task identifier, so after validating tasksJsonPath the function checks id and rejects the call with code MISSING_TASK_ID.","triggerScenarios":"Calling set-task-status with tasksJsonPath and status but no id, or id empty/null (e.g. the id came from an unresolved variable or failed lookup upstream).","commonSituations":"Automation pipelines where the task id is fetched dynamically and the fetch failed; UI/agent flows that submit a status update before a task is selected; string-vs-number confusion leaving id undefined.","solutions":["Provide the task id in the arguments (e.g. id: '5' or a subtask id '5.2')","Verify the upstream source of the id actually resolved to a value before calling","Confirm the argument key is 'id' and is a non-empty string/number"],"exampleFix":"// before\nawait client.callTool('set-task-status', { tasksJsonPath: './.taskmaster/tasks.json', status: 'done' });\n// after\nawait client.callTool('set-task-status', { tasksJsonPath: './.taskmaster/tasks.json', id: '5', status: 'done' });","handlingStrategy":"validation","validationCode":"if (!args?.id) throw new Error('set-task-status requires a task id');","typeGuard":"function hasId(args) { return typeof args?.id === 'string' ? args.id.length > 0 : typeof args?.id === 'number'; }","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_TASK_ID')) { /* re-select a task and retry */ } else throw e; }","preventionTips":["Resolve the task id from a list-tasks call before updating status","Coerce/validate id to a non-empty string or number at the boundary","Fail fast in pipelines when a task lookup returns no id"],"tags":["mcp","validation","missing-task-id"],"backgroundTag":"missing-required-parameter","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}