eyaltoledano/claude-task-master · error
MISSING_ARGUMENT
MISSING_ARGUMENT
Error message
tasksJsonPath is required but was not provided.
What it means
updateSubtaskByIdDirect requires the filesystem path to tasks.json (`tasksJsonPath`) because file-based storage needs to know where the task data lives. When the argument is missing/empty it returns MISSING_ARGUMENT immediately without attempting any update. This guard exists because unlike API storage, the file provider cannot infer the path.
Source
Thrown at mcp-server/src/core/direct-functions/update-subtask-by-id.js:48
const { session } = context;
// Destructure expected args, including projectRoot and metadata
const { tasksJsonPath, id, prompt, research, metadata, projectRoot, tag } =
args;
const logWrapper = createLogWrapper(log);
try {
logWrapper.info(
`Updating subtask by ID via direct function. ID: ${id}, ProjectRoot: ${projectRoot}`
);
// Check if tasksJsonPath was provided
if (!tasksJsonPath) {
const errorMessage = 'tasksJsonPath is required but was not provided.';
logWrapper.error(errorMessage);
return {
success: false,
error: { code: 'MISSING_ARGUMENT', message: errorMessage }
};
}
// Basic validation - ID must be present
// In API storage, subtask IDs like "HAM-2611" are valid (no dot required)
// In file storage, subtask IDs must be in format "parentId.subtaskId"
// The core function handles storage-specific validation
if (!id || typeof id !== 'string' || !id.trim()) {
const errorMessage = 'Subtask ID cannot be empty.';
logWrapper.error(errorMessage);
return {
success: false,
error: { code: 'INVALID_SUBTASK_ID', message: errorMessage }
};
}
// At least prompt or metadata is required (validated in MCP tool layer)
if (!prompt && !metadata) {View on GitHub (pinned to c0c98d367c)
Solutions
- Pass the absolute path to your tasks file, e.g. /path/to/project/.taskmaster/tasks/tasks.json.
- If using API/Supabase storage, ensure the tool/schema variant you call does not require tasksJsonPath, or supply a placeholder per your setup docs.
- Check the tool registration in your MCP client so the tasksJsonPath argument is forwarded, not stripped.
Example fix
// before
await updateSubtask({ id: '5.2', prompt: 'Add tests' });
// after
await updateSubtask({ id: '5.2', prompt: 'Add tests', tasksJsonPath: '/proj/.taskmaster/tasks/tasks.json' }); Defensive patterns
Strategy: validation
Validate before calling
if (typeof tasksJsonPath !== 'string' || !tasksJsonPath.trim()) {
throw new Error('tasksJsonPath is required (path to tasks.json)');
}
if (!fs.existsSync(tasksJsonPath)) throw new Error(`tasks.json not found: ${tasksJsonPath}`); Type guard
function hasTasksPath(a) { return typeof a.tasksJsonPath === 'string' && a.tasksJsonPath.trim().length > 0; } Prevention
- Build a single config/helper that resolves the tasks.json path once per project
- Never pass falsy values through generic argument builders — filter consciously
- For API storage, use the appropriate tool variant that does not require the path
When it happens
Trigger: Calling the update-subtask-by-id MCP tool with id/prompt but omitting tasksJsonPath, or passing an empty string; a client wrapper that filters out path arguments it considers secrets.
Common situations: Migrating from API-backed storage where tasksJsonPath was unnecessary; copying example calls from API-mode docs into file-mode setups; agents dropping the path because it looks like boilerplate.
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/4b9cd003621866e5.
Report an issue: GitHub.