eyaltoledano/claude-task-master · error

INPUT_VALIDATION_ERROR

INPUT_VALIDATION_ERROR

Error message

Task ID (id) is required

What it means

After confirming tasksJsonPath exists, addDependencyDirect validates that the id parameter — the task that will receive the new dependency — is present. Missing id yields a structured INPUT_VALIDATION_ERROR result rather than a thrown error. This prevents the core function from attempting dependency resolution against an undefined task identifier.

Solutions

  1. Include the id argument with the ID of the task that should depend on another.
  2. Check parameter naming — the tool expects exactly id, not taskId or task_id.
  3. Confirm the value is non-empty (e.g. '3' or 'HAM-123'), not an empty string.
  4. Consult the add_dependency tool schema exposed by the MCP server for the correct argument list.

Example fix

// before
await addDependencyDirect({ tasksJsonPath, dependsOn: '1' });
// after
await addDependencyDirect({ tasksJsonPath, id: '3', dependsOn: '1' });
Defensive patterns

Strategy: validation

Validate before calling

function assertTaskId(args) {
  const id = args?.id;
  if (typeof id !== 'string' || id.trim() === '') {
    throw new Error('Task ID (id) is required');
  }
}

Type guard

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

Try / catch

if (!hasTaskId(args)) {
  return { success: false, error: { code: 'INPUT_VALIDATION_ERROR', message: 'Task ID (id) is required' } };
}

Prevention

When it happens

Trigger: Invoking the add_dependency tool with tasksJsonPath and dependsOn but omitting id; a client mapping argument names incorrectly (e.g. sending taskId instead of id) so id is undefined.

Common situations: LLM-generated tool calls that guess parameter names; hand-written MCP client code that predates a parameter rename; batch scripts building arguments dynamically where the id key is mistyped.

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/75b6d6eec11969b2. Report an issue: GitHub.

Appendix: source

Thrown at mcp-server/src/core/direct-functions/add-dependency.js:47

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

		// Validate required parameters
		if (!id) {
			return {
				success: false,
				error: {
					code: 'INPUT_VALIDATION_ERROR',
					message: 'Task ID (id) is required'
				}
			};
		}

		if (!dependsOn) {
			return {
				success: false,
				error: {
					code: 'INPUT_VALIDATION_ERROR',
					message: 'Dependency ID (dependsOn) is required'
				}
			};
		}

		// Use provided path
		const tasksPath = tasksJsonPath;

View on GitHub (pinned to c0c98d367c)