eyaltoledano/claude-task-master · error

MISSING_ARGUMENT

MISSING_ARGUMENT

Error message

tasksJsonPath is required

What it means

listTagsDirect requires tasksJsonPath because listing tags reads the tag map stored in tasks.json. When the argument is falsy it logs the failure, disables silent mode, and returns a MISSING_ARGUMENT error result before attempting any file access.

Source

Thrown at mcp-server/src/core/direct-functions/list-tags.js:43

	// Destructure expected args
	const { tasksJsonPath, showMetadata = false, 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('listTagsDirect called without tasksJsonPath');
			disableSilentMode();
			return {
				success: false,
				error: {
					code: 'MISSING_ARGUMENT',
					message: 'tasksJsonPath is required'
				}
			};
		}

		log.info('Listing all tags');

		// Prepare options
		const options = {
			showMetadata
		};

		// Call the tags function
		const result = await tags(
			tasksJsonPath,
			options,
			{
				session,

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Pass tasksJsonPath: <projectRoot>/.taskmaster/tasks/tasks.json in the call
  2. Resolve the path from projectRoot if the caller only knows the root
  3. Update client tool-call code so the argument is always forwarded

Example fix

// before
await mcp.call('list_tags', {});
// after
await mcp.call('list_tags', { tasksJsonPath: '/repo/.taskmaster/tasks/tasks.json' });
Defensive patterns

Strategy: validation

Validate before calling

import path from 'path';
function assertTasksJsonPath(args) {
  if (typeof args.tasksJsonPath !== 'string' || args.tasksJsonPath === '') {
    args.tasksJsonPath = path.join(args.projectRoot ?? '', '.taskmaster', 'tasks', 'tasks.json');
  }
  if (args.tasksJsonPath === '' || args.tasksJsonPath === '/.taskmaster/tasks/tasks.json') {
    throw new Error('Cannot derive tasksJsonPath: provide projectRoot or tasksJsonPath');
  }
  return args;
}

Type guard

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

Try / catch

const res = await callTool('list_tags', { tasksJsonPath });
if (!res.success && res.error?.code === 'MISSING_ARGUMENT') {
  console.error('list_tags requires tasksJsonPath; pass <root>/.taskmaster/tasks/tasks.json');
}

Prevention

When it happens

Trigger: Calling the list_tags MCP tool without tasksJsonPath (or passing null/empty string).

Common situations: Client wrappers assuming tags are global rather than per-file; configs forwarding only projectRoot; API drift after tasksJsonPath became mandatory for tag operations.

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