eyaltoledano/claude-task-master · error

INPUT_VALIDATION_ERROR

INPUT_VALIDATION_ERROR

Error message

Subtask ID is required and must be in format "parentId.subtaskId"

What it means

removeSubtaskDirect validates that an `id` argument is present before parsing it. If `id` is undefined/empty it returns INPUT_VALIDATION_ERROR, because a subtask can only be removed when identified as `parentId.subtaskId`. This guards the core removeSubtask from operating on nothing.

Source

Thrown at mcp-server/src/core/direct-functions/remove-subtask.js:50

		// Check if tasksJsonPath was provided
		if (!tasksJsonPath) {
			log.error('removeSubtaskDirect called without tasksJsonPath');
			disableSilentMode(); // Disable before returning
			return {
				success: false,
				error: {
					code: 'MISSING_ARGUMENT',
					message: 'tasksJsonPath is required'
				}
			};
		}

		if (!id) {
			disableSilentMode(); // Disable before returning
			return {
				success: false,
				error: {
					code: 'INPUT_VALIDATION_ERROR',
					message:
						'Subtask ID is required and must be in format "parentId.subtaskId"'
				}
			};
		}

		// Validate subtask ID format
		if (!id.includes('.')) {
			disableSilentMode(); // Disable before returning
			return {
				success: false,
				error: {
					code: 'INPUT_VALIDATION_ERROR',
					message: `Invalid subtask ID format: ${id}. Expected format: "parentId.subtaskId"`
				}
			};
		}

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Include `id` in the tool call args in `parentId.subtaskId` form (e.g. "5.3").
  2. Check that the variable feeding args.id is actually populated (don't pass an un-interpolated template value).
  3. If you meant to remove a whole task, use the remove_task tool instead of remove_subtask.
  4. Log the full args object before the call to confirm the id survives your client-side mapping.

Example fix

// before
await removeSubtaskDirect({ tasksJsonPath: path, id: undefined, log });
// after
await removeSubtaskDirect({ tasksJsonPath: path, id: `${parentId}.${subtaskId}`, log });
Defensive patterns

Strategy: validation

Validate before calling

function assertSubtaskId(args) {
  if (typeof args?.id !== 'string' || args.id.trim() === '') {
    throw new Error('id is required for remove_subtask, e.g. "5.3"');
  }
  return args.id.trim();
}

Type guard

function hasSubtaskId(args) {
  return typeof args?.id === 'string' && args.id.trim().length > 0;
}

Try / catch

const result = await removeSubtaskDirect(args, log);
if (!result.success && result.error?.code === 'INPUT_VALIDATION_ERROR' && !args.id) {
  throw new Error('remove_subtask requires id in "parentId.subtaskId" form');
}

Prevention

When it happens

Trigger: Invoking the remove_subtask tool with no `id` argument, an empty string, or an args object where `id` was renamed or omitted (e.g. passing `subtaskId` or `taskId` instead).

Common situations: Client code mapping the wrong CLI flag to the tool args; LLM tool calls that omit the id parameter; templates that forgot to interpolate the id variable into the args object.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/66a274cac22d02ee. Report an issue: GitHub.