eyaltoledano/claude-task-master · error

MISSING_ARGUMENT

MISSING_ARGUMENT

Error message

tasksJsonPath is required

What it means

addTagDirect refuses to run when the tasksJsonPath argument is missing or empty. This is a guard at the top of the MCP direct function because every tag operation needs to know where .taskmaster/config.json (or tasks.json) lives. It returns a structured error object with code MISSING_ARGUMENT instead of throwing.

Source

Thrown at mcp-server/src/core/direct-functions/add-tag.js:58

		projectRoot
	} = args;
	const { session } = context;

	// Enable silent mode to prevent console logs from interfering with JSON response
	enableSilentMode();

	// Create logger wrapper using the utility
	const mcpLog = createLogWrapper(log);

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

		// Handle --from-branch option
		if (fromBranch) {
			log.info('Creating tag from current git branch');

			// Import git utilities
			const gitUtils = await import(
				'../../../../scripts/modules/utils/git-utils.js'
			);

			// Check if we're in a git repository
			if (!(await gitUtils.isGitRepository(projectRoot))) {
				log.error('Not in a git repository');
				disableSilentMode();

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Pass the absolute path to your .taskmaster/tasks.json (or project .taskmaster/config.json) as tasksJsonPath in the tool call
  2. Regenerate/refresh the MCP client's tool schema so tasksJsonPath is included as a required argument
  3. Check the tool invocation payload for typos in the argument name (e.g. tasksPath vs tasksJsonPath)

Example fix

// before
add_tag({ name: 'release-1' });
// after
add_tag({ tasksJsonPath: '/project/.taskmaster/tasks.json', name: 'release-1' });
Defensive patterns

Strategy: validation

Validate before calling

const tasksJsonPath = args?.tasksJsonPath;
if (!tasksJsonPath || typeof tasksJsonPath !== 'string') {
  throw new Error('add_tag requires a non-empty tasksJsonPath string');
}

Type guard

function hasTasksJsonPath(a) {
  return typeof a === 'object' && a !== null && typeof a.tasksJsonPath === 'string' && a.tasksJsonPath.length > 0;
}

Try / catch

try {
  const res = await addTagDirect(args);
  if (!res.success && res.error?.code === 'MISSING_ARGUMENT') { /* prompt for tasksJsonPath */ }
} catch (e) { /* unexpected transport failure */ }

Prevention

When it happens

Trigger: Calling the add_tag MCP tool without the tasksJsonPath parameter, or passing an empty string/undefined for it from the tool caller.

Common situations: MCP client tool schema out of sync with server version; a wrapper script dropping arguments; hand-crafted tool calls omitting required fields.

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