eyaltoledano/claude-task-master · error
MISSING_ARGUMENT
MISSING_ARGUMENT
Error message
projectRoot is required.
What it means
parsePRDDirect requires a `projectRoot` argument and rejects the call up front when it is falsy (parse-prd.js:52-61). projectRoot anchors all path resolution — PRD input, output tasks.json, and config defaults — so without it the function cannot resolve any filesystem paths safely.
Source
Thrown at mcp-server/src/core/direct-functions/parse-prd.js:57
output: outputArg,
numTasks: numTasksArg,
force,
append,
research,
projectRoot,
tag
} = args;
// Create the standard logger wrapper
const logWrapper = createLogWrapper(log);
// --- Input Validation and Path Resolution ---
if (!projectRoot) {
logWrapper.error('parsePRDDirect requires a projectRoot argument.');
return {
success: false,
error: {
code: 'MISSING_ARGUMENT',
message: 'projectRoot is required.'
}
};
}
// Resolve input path using path utilities
let inputPath;
if (inputArg) {
try {
inputPath = resolvePrdPath({ input: inputArg, projectRoot }, session);
} catch (error) {
logWrapper.error(`Error resolving PRD path: ${error.message}`);
return {
success: false,
error: { code: 'FILE_NOT_FOUND', message: error.message }
};
}
} else {View on GitHub (pinned to c0c98d367c)
Solutions
- Pass the absolute path to your project root as `projectRoot`.
- If you are the tool caller, ensure the MCP client forwards projectRoot (it is a required arg for parse_prd).
- If root is dynamic, resolve it before the call (e.g. process.cwd() or the directory containing .taskmaster/).
Example fix
// before
await parsePRDDirect({ input: './docs/prd.txt' }, log);
// after
await parsePRDDirect({ input: './docs/prd.txt', projectRoot: '/abs/path/to/project' }, log); Defensive patterns
Strategy: validation
Validate before calling
const fs = require('fs');
if (!args?.projectRoot) throw new Error('projectRoot is required');
if (!fs.existsSync(args.projectRoot)) throw new Error(`projectRoot does not exist: ${args.projectRoot}`); Type guard
function hasProjectRoot(args) {
return typeof args === 'object' && args !== null && typeof args.projectRoot === 'string' && args.projectRoot.length > 0;
} Prevention
- Always include projectRoot in parse_prd tool arguments.
- Use an absolute path resolved via path.resolve before the call.
- In agents/MCP clients, default projectRoot to the workspace root or process.cwd().
- Confirm the directory contains .taskmaster/ or will host it.
When it happens
Trigger: Calling the MCP `parse_prd` tool without `projectRoot` in args, or with an empty-string projectRoot; calling parsePRDDirect directly from code and forgetting the argument.
Common situations: Custom MCP clients or agents constructing tool arguments manually and omitting projectRoot; callers that assumed the server would infer the root from the session/cwd but called the direct function directly, which does no inference.
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
- INPUT_VALIDATION_ERROR
- INPUT_VALIDATION_ERROR
- MISSING_ARGUMENT
- projectRoot is required in args to resolve project paths
- MCP provider requires session object
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/eeb52496cfa0b06e.
Report an issue: GitHub.