eyaltoledano/claude-task-master · error
MISSING_ARGUMENT
MISSING_ARGUMENT
Error message
tasksJsonPath is required
What it means
addTaskDirect requires tasksJsonPath to locate the tasks store; without it the function cannot read or write tasks. It returns a structured MISSING_ARGUMENT error instead of throwing, mirroring the guard used by other direct functions.
Source
Thrown at mcp-server/src/core/direct-functions/add-task.js:59
tag
} = args;
const { session } = context; // Destructure session from 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('addTaskDirect called without tasksJsonPath');
disableSilentMode(); // Disable before returning
return {
success: false,
error: {
code: 'MISSING_ARGUMENT',
message: 'tasksJsonPath is required'
}
};
}
// Use provided path
const tasksPath = tasksJsonPath;
// Check if this is manual task creation or AI-driven task creation
const isManualCreation = args.title && args.description;
// Check required parameters
if (!args.prompt && !isManualCreation) {
log.error(
'Missing required parameters: either prompt or title+description must be provided'
);
disableSilentMode();
return {View on GitHub (pinned to c0c98d367c)
Solutions
- Pass the absolute path to .taskmaster/tasks.json as tasksJsonPath
- Refresh the MCP client's cached tool schema so the required argument is sent
- Verify argument spelling in the tool call payload
Example fix
// before
add_task({ prompt: 'Add login' });
// after
add_task({ tasksJsonPath: '/project/.taskmaster/tasks.json', prompt: 'Add login' }); Defensive patterns
Strategy: validation
Validate before calling
const tasksJsonPath = args?.tasksJsonPath;
if (!tasksJsonPath || typeof tasksJsonPath !== 'string') {
throw new Error('add_task 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
const res = await addTaskDirect(args);
if (!res.success && res.error?.code === 'MISSING_ARGUMENT') {
// configure/collect tasksJsonPath and retry once
} Prevention
- Centralize tasksJsonPath resolution in one config helper
- Validate all required tool args before dispatch
- Re-sync MCP client schemas after task-master upgrades
When it happens
Trigger: Calling the add_task MCP tool without tasksJsonPath, with undefined, or with an empty string.
Common situations: MCP client schema mismatch after upgrading task-master; wrapper code dropping arguments; manual tool invocation missing the required field.
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/0b50c380f71d14d0.
Report an issue: GitHub.