{"record":{"id":"5d470f4908ebf164","repo":"eyaltoledano/claude-task-master","slug":"input-validation-error-5d470f","errorCode":"INPUT_VALIDATION_ERROR","errorMessage":"Task ID is required","messagePattern":"Task ID is required","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"mcp-server/src/core/direct-functions/remove-task.js","lineNumber":51,"sourceCode":"\t\t// Check if tasksJsonPath was provided\n\t\tif (!tasksJsonPath) {\n\t\t\tlog.error('removeTaskDirect called without tasksJsonPath');\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// Validate task ID parameter\n\t\tif (!id) {\n\t\t\tlog.error('Task ID is required');\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'INPUT_VALIDATION_ERROR',\n\t\t\t\t\tmessage: 'Task ID is required'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t// Split task IDs if comma-separated\n\t\tconst taskIdArray = id.split(',').map((taskId) => taskId.trim());\n\n\t\tlog.info(\n\t\t\t`Removing ${taskIdArray.length} task(s) with ID(s): ${taskIdArray.join(', ')} from ${tasksJsonPath}${tag ? ` in tag '${tag}'` : ''}`\n\t\t);\n\n\t\t// Validate all task IDs exist before proceeding\n\t\tconst data = readJSON(tasksJsonPath, projectRoot, tag);\n\t\tif (!data || !data.tasks) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/remove-task.js#L33-L69","documentation":"removeTaskDirect requires an `id` parameter specifying which task(s) to remove. When the MCP client omits or passes an empty/falsy `id`, the function short-circuits before any file access and returns this INPUT_VALIDATION_ERROR instead of attempting the removal.","triggerScenarios":"Calling the remove_task MCP tool without the `id` argument, with `id: null`/`undefined`/empty string, or a tool schema/client that fails to forward the id parameter.","commonSituations":"A client built against an older tool schema that lacked `id`; an LLM agent omitting optional-looking parameters; hand-rolled MCP requests missing required fields; id accidentally nested inside another object instead of top-level.","solutions":["Pass the task id (or comma-separated list of ids) explicitly in the remove_task tool call, e.g. id=\"5\" or id=\"5,6\"","Regenerate/refresh the MCP client so it uses the current remove_task input schema where `id` is required","If an agent is calling the tool, instruct it to resolve the task id first (e.g. via get_tasks) before removing","Check argument serialization so the id is at the top level of the args object, not nested"],"exampleFix":"// before\nawait client.callTool('remove_task', {});\n\n// after\nawait client.callTool('remove_task', { id: '5', projectRoot: '/path/to/project' });","handlingStrategy":"validation","validationCode":"const id = args?.id;\nif (typeof id !== 'string' || id.trim().length === 0) {\n  throw new Error('remove_task requires a non-empty id, e.g. \"5\" or \"5,6\"');\n}","typeGuard":"function hasTaskId(args) {\n  return typeof args === 'object' && args !== null && 'id' in args &&\n    typeof args.id === 'string' && args.id.trim().length > 0;\n}","tryCatchPattern":"try {\n  const res = await client.callTool('remove_task', { id });\n  if (res.error?.code === 'INPUT_VALIDATION_ERROR') {\n    console.error('Missing task id — pass id like \"5\" or \"5,6\"');\n  }\n} catch (e) {\n  console.error('remove_task failed:', e.message);\n}","preventionTips":["Always resolve the task id (via get_tasks/list) before calling remove_task","Validate required tool arguments in a thin wrapper around callTool","Keep MCP client schemas regenerated from the current server tool definitions"],"tags":["mcp","validation","missing-parameter"],"backgroundTag":"missing-required-parameter","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}