eyaltoledano/claude-task-master · error

MISSING_TASK_ID

MISSING_TASK_ID

Error message

No task ID specified. Please provide a task ID to update.

What it means

setTaskStatusDirect returns this error when the 'id' argument is missing. Updating a status requires a task identifier, so after validating tasksJsonPath the function checks id and rejects the call with code MISSING_TASK_ID.

Source

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

		// 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);
			return {
				success: false,
				error: { code: 'MISSING_STATUS', message: errorMessage }
			};
		}

		// Use the provided path
		const tasksPath = tasksJsonPath;

		// Execute core setTaskStatus function
		const taskId = id;

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Provide the task id in the arguments (e.g. id: '5' or a subtask id '5.2')
  2. Verify the upstream source of the id actually resolved to a value before calling
  3. Confirm the argument key is 'id' and is a non-empty string/number

Example fix

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

Strategy: validation

Validate before calling

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

Type guard

function hasId(args) { return typeof args?.id === 'string' ? args.id.length > 0 : typeof args?.id === 'number'; }

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_TASK_ID')) { /* re-select a task and retry */ } else throw e; }

Prevention

When it happens

Trigger: Calling set-task-status with tasksJsonPath and status but no id, or id empty/null (e.g. the id came from an unresolved variable or failed lookup upstream).

Common situations: Automation pipelines where the task id is fetched dynamically and the fetch failed; UI/agent flows that submit a status update before a task is selected; string-vs-number confusion leaving id undefined.

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