eyaltoledano/claude-task-master · error
MISSING_ARGUMENT
MISSING_ARGUMENT
Error message
tasksJsonPath is required
What it means
copyTagDirect wraps the tag-copy operation, which duplicates an entire tag's task list within a tasks.json file. It requires tasksJsonPath to know which tasks file to operate on; without it there is no safe default, so it returns MISSING_ARGUMENT immediately and disables silent mode.
Source
Thrown at mcp-server/src/core/direct-functions/copy-tag.js:46
const { tasksJsonPath, sourceName, targetName, description, 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('copyTagDirect called without tasksJsonPath');
disableSilentMode();
return {
success: false,
error: {
code: 'MISSING_ARGUMENT',
message: 'tasksJsonPath is required'
}
};
}
// Check required parameters
if (!sourceName || typeof sourceName !== 'string') {
log.error('Missing required parameter: sourceName');
disableSilentMode();
return {
success: false,
error: {
code: 'MISSING_PARAMETER',
message: 'Source tag name is required and must be a string'
}
};
}
View on GitHub (pinned to c0c98d367c)
Solutions
- Pass tasksJsonPath explicitly, typically '.taskmaster/tasks.json' resolved against projectRoot
- Ensure the MCP client sends the full argument object including tasksJsonPath
- If path is derived, resolve it before calling (path.join(projectRoot, '.taskmaster/tasks.json')) and assert it is non-empty
Example fix
// before
await copyTagDirect({ sourceName: 'backlog', targetName: 'sprint-1' });
// after
await copyTagDirect({ tasksJsonPath: path.join(projectRoot, '.taskmaster/tasks.json'), sourceName: 'backlog', targetName: 'sprint-1', projectRoot }); Defensive patterns
Strategy: validation
Validate before calling
if (typeof tasksJsonPath !== 'string' || tasksJsonPath.trim() === '') throw new Error('tasksJsonPath is required'); Type guard
function hasTasksPath(a) { return typeof a === 'object' && a !== null && typeof a.tasksJsonPath === 'string' && a.tasksJsonPath.length > 0; } Try / catch
const res = await copyTagDirect(args); if (!res.success && res.error.code === 'MISSING_ARGUMENT') { console.error(res.error.message); } Prevention
- Centralize the tasks.json path resolution in one helper
- Include tasksJsonPath in the MCP client tool schema as required
- Resolve the path against projectRoot rather than assuming cwd
When it happens
Trigger: Calling the copy-tag MCP tool without tasksJsonPath in the arguments; destructured args where the client omitted the path; custom tool registration that doesn't forward the parameter.
Common situations: MCP clients relying on a default .taskmaster/tasks.json that the tool doesn't apply; refactored callers that renamed the parameter; missing projectRoot causing the resolved path to be dropped.
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/b67a6b14bc65ffdb.
Report an issue: GitHub.