{"record":{"id":"4f74e7022b406610","repo":"eyaltoledano/claude-task-master","slug":"input-validation-error-4f74e7","errorCode":"INPUT_VALIDATION_ERROR","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/update-task-by-id.js","lineNumber":59,"sourceCode":"\t\tprojectRoot,\n\t\ttag\n\t} = args;\n\n\tconst logWrapper = createLogWrapper(log);\n\n\ttry {\n\t\tlogWrapper.info(\n\t\t\t`Updating task by ID via direct function. ID: ${id}, ProjectRoot: ${projectRoot}`\n\t\t);\n\n\t\t// Check required parameters (id and prompt)\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\tlogWrapper.error(errorMessage);\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: 'INPUT_VALIDATION_ERROR', message: errorMessage }\n\t\t\t};\n\t\t}\n\n\t\t// At least prompt or metadata is required (validated in MCP tool layer)\n\t\tif (!prompt && !metadata) {\n\t\t\tconst errorMessage =\n\t\t\t\t'No prompt or metadata specified. Please provide a prompt with new information or metadata for the task update.';\n\t\t\tlogWrapper.error(errorMessage);\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: { code: 'INPUT_VALIDATION_ERROR', message: errorMessage }\n\t\t\t};\n\t\t}\n\n\t\t// Parse taskId - handle numeric, alphanumeric, and subtask IDs\n\t\tlet taskId;\n\t\tif (typeof id === 'string') {\n\t\t\t// Keep ID as string - supports numeric (1, 2), alphanumeric (TAS-49, JIRA-123), and subtask IDs (1.2, TAS-49.1)","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/update-task-by-id.js#L41-L77","documentation":"updateTaskByIdDirect requires a task `id` to know which task to update; when it is missing it returns INPUT_VALIDATION_ERROR immediately. This is the first guard in the function, before checking that a prompt or metadata was supplied.","triggerScenarios":"Calling the update-task-by-id MCP tool without the id argument, id: null/undefined, or an empty string; a client-side argument builder that omits falsy values.","commonSituations":"Agents composing tool calls dynamically and dropping the id field; clients filtering arguments against an outdated schema where id was assumed optional.","solutions":["Pass the task ID explicitly, e.g. { id: '5', prompt: 'Update notes' } (also accepts '5.2' style for subtasks via the same path).","Ensure your MCP client schema marks id as required so the model/transport always includes it.","Confirm the id variable is populated at the call site (log arguments before invoking)."],"exampleFix":"// before\nawait updateTask({ prompt: 'New details' });\n// after\nawait updateTask({ id: '5', prompt: 'New details' });","handlingStrategy":"validation","validationCode":"if (typeof id !== 'string' && typeof id !== 'number') throw new Error('task id is required');\nif (String(id).trim() === '') throw new Error('task id cannot be empty');","typeGuard":"function hasTaskId(a) { return a.id !== null && a.id !== undefined && String(a.id).trim().length > 0; }","tryCatchPattern":null,"preventionTips":["Mark id as required in your MCP client tool schema","Validate the full argument object at the boundary before every tool call","Avoid generic arg builders that silently drop falsy fields"],"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"}