eyaltoledano/claude-task-master · error

MISSING_ARGUMENT

MISSING_ARGUMENT

Error message

tasksJsonPath is required but was not provided.

What it means

setTaskStatusDirect returns this error when the 'tasksJsonPath' argument is not provided. The tool must know where tasks.json lives to update a task's status, so it fails fast with code MISSING_ARGUMENT before checking id or status.

Source

Thrown at mcp-server/src/core/direct-functions/set-task-status.js:40

 * @param {Object} log - Logger object.
 * @param {Object} context - Additional context (session)
 * @returns {Promise<Object>} - Result object with success status and data/error information.
 */
export async function setTaskStatusDirect(args, log, context = {}) {
	// Destructure expected args, including the resolved tasksJsonPath and projectRoot
	const { tasksJsonPath, id, status, complexityReportPath, projectRoot, tag } =
		args;
	const { session } = context;
	try {
		log.info(`Setting task status with args: ${JSON.stringify(args)}`);

		// Check if tasksJsonPath was provided
		if (!tasksJsonPath) {
			const errorMessage = 'tasksJsonPath is required but was not provided.';
			log.error(errorMessage);
			return {
				success: false,
				error: { code: 'MISSING_ARGUMENT', message: errorMessage }
			};
		}

		// Check required parameters (id and status)
		if (!id) {
			const errorMessage =
				'No task ID specified. Please provide a task ID to update.';
			log.error(errorMessage);
			return {
				success: false,
				error: { code: 'MISSING_TASK_ID', message: errorMessage }
			};
		}

		if (!status) {
			const errorMessage =
				'No status specified. Please provide a new status value.';
			log.error(errorMessage);

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Pass tasksJsonPath pointing to the project's tasks.json in the tool arguments
  2. Initialize/verify the taskmaster project so tasks.json exists and its path is known
  3. Check the MCP client config that supplies default tool arguments

Example fix

// before
await client.callTool('set-task-status', { id: '5', status: 'done' });
// after
await client.callTool('set-task-status', { tasksJsonPath: '/app/.taskmaster/tasks.json', id: '5', status: 'done' });
Defensive patterns

Strategy: validation

Validate before calling

if (!args?.tasksJsonPath) throw new Error('set-task-status requires tasksJsonPath');

Type guard

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

Try / catch

try { const r = await callTool('set-task-status', args); if (!r.success) throw new Error(`${r.error.code}: ${r.error.message}`); } catch (e) { if (e.message.includes('MISSING_ARGUMENT')) { /* supply tasksJsonPath and retry */ } else throw e; }

Prevention

When it happens

Trigger: Calling the set-task-status MCP tool without tasksJsonPath, with an empty string, or with the argument dropped during client-side argument serialization.

Common situations: MCP server launched outside the project directory so no default path was supplied; clients built before tasksJsonPath was a required argument (version/API change); typos in the argument name.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


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