eyaltoledano/claude-task-master · error

MISSING_ARGUMENT

MISSING_ARGUMENT

Error message

tasksJsonPath is required

What it means

MISSING_ARGUMENT with 'tasksJsonPath is required' is returned by removeDependencyDirect when the args object has no tasksJsonPath. This wrapper requires an explicit path to the tasks.json file and does not fall back to defaults. It is a guard returning a structured error object (success:false), not a thrown exception.

Source

Thrown at mcp-server/src/core/direct-functions/remove-dependency.js:34

 * @param {string|number} args.dependsOn - Task ID to remove as a dependency
 * @param {string} args.projectRoot - Project root path (for MCP/env fallback)
 * @param {string} args.tag - Tag for the task (optional)
 * @param {Object} log - Logger object
 * @returns {Promise<{success: boolean, data?: Object, error?: {code: string, message: string}}>}
 */
export async function removeDependencyDirect(args, log) {
	// Destructure expected args
	const { tasksJsonPath, id, dependsOn, projectRoot, tag } = args;
	try {
		log.info(`Removing dependency with args: ${JSON.stringify(args)}`);

		// Check if tasksJsonPath was provided
		if (!tasksJsonPath) {
			log.error('removeDependencyDirect 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 {

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Pass an explicit absolute path to tasks.json in args.tasksJsonPath
  2. Ensure the MCP tool call includes the tasksJsonPath parameter
  3. Verify the client-side tool schema requires/forwards tasksJsonPath
  4. If only projectRoot is known, resolve <projectRoot>/.taskmaster/tasks.json (or tagged variant) and pass that path

Example fix

// before
await removeDependencyDirect({ id: 5, dependsOn: 3, projectRoot }, log);
// after
await removeDependencyDirect({ tasksJsonPath: '/proj/.taskmaster/tasks.json', id: 5, dependsOn: 3, projectRoot }, log);
Defensive patterns

Strategy: validation

Validate before calling

if (!args || typeof args.tasksJsonPath !== 'string' || args.tasksJsonPath.trim() === '') {
  throw new Error('tasksJsonPath must be a non-empty string');
}

Type guard

function hasTasksJsonPath(args) {
  return typeof args?.tasksJsonPath === 'string' && args.tasksJsonPath.length > 0;
}

Try / catch

const result = await removeDependencyDirect(args, log);
if (!result.success && result.error.code === 'MISSING_ARGUMENT') {
  console.error('Missing argument:', result.error.message); // 'tasksJsonPath is required'
}

Prevention

When it happens

Trigger: Calling removeDependencyDirect(args, log) where args.tasksJsonPath is undefined, null, or an empty string — e.g. the MCP tool invocation omitted the tasksJsonPath parameter.

Common situations: MCP client invokes remove_dependency tool without passing tasksJsonPath; a tool config or client schema mismatch drops the parameter; caller assumed projectRoot alone would resolve the path.

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