eyaltoledano/claude-task-master · error
PARSE_PRD_CORE_ERROR
PARSE_PRD_CORE_ERROR
Error message
${error.message || 'Unknown error parsing PRD'} What it means
PARSE_PRD_CORE_ERROR is the catch-all failure envelope returned by parsePRDDirect when the underlying core parsePRD function throws an unexpected exception (e.g. unreadable PRD file, AI-provider failure, or invalid output path). parsePRDDirect wraps the core call in try/catch and converts any thrown error into this structured MCP response instead of crashing. The message is taken from the thrown error, falling back to 'Unknown error parsing PRD' when the error has no message.
Source
Thrown at mcp-server/src/core/direct-functions/parse-prd.js:207
logWrapper.error(
'Core parsePRD function did not return a successful structure.'
);
return {
success: false,
error: {
code: 'CORE_FUNCTION_ERROR',
message:
result?.message ||
'Core function failed to parse PRD or returned unexpected result.'
}
};
}
} catch (error) {
logWrapper.error(`Error executing core parsePRD: ${error.message}`);
return {
success: false,
error: {
code: 'PARSE_PRD_CORE_ERROR',
message: error.message || 'Unknown error parsing PRD'
}
};
} finally {
if (!wasSilent && isSilentMode()) {
disableSilentMode();
}
}
}
View on GitHub (pinned to c0c98d367c)
Solutions
- Read the message field — it carries the underlying core error; fix that root cause first
- Verify the PRD input file exists and is readable at the given inputPath
- Check AI provider configuration (API key, model) since parsePRD depends on an AI call
- Confirm outputPath is writable and numTasks is a valid positive number
- Retry the parse-prd call; transient AI provider failures surface here
Example fix
// before: parse-prd called without verifying the PRD file
await parsePRDDirect({ projectRoot, inputPath: 'docs/prd.txt' }, log);
// after: validate inputs before calling
const fs = await import('fs');
if (!fs.existsSync('docs/prd.txt')) throw new Error('PRD file not found');
const result = await parsePRDDirect({ projectRoot, inputPath: 'docs/prd.txt', numTasks: 10 }, log);
if (!result.success) console.error(result.error.message); Defensive patterns
Strategy: try-catch
Validate before calling
import fs from 'fs';
if (!args.inputPath || !fs.existsSync(args.inputPath)) {
throw new Error('PRD input file does not exist: ' + args.inputPath);
}
if (args.numTasks != null && (!Number.isInteger(args.numTasks) || args.numTasks < 1)) {
throw new Error('numTasks must be a positive integer');
} Type guard
function isParsePrdResult(r) {
return r != null && typeof r === 'object' && typeof r.success === 'boolean'
&& (r.success === false ? r.error?.code != null : typeof r.data?.outputPath === 'string');
} Try / catch
const result = await parsePRDDirect(args, log);
if (!result.success) {
if (result.error.code === 'PARSE_PRD_CORE_ERROR') {
console.error('PRD parse failed:', result.error.message);
// fix inputs / AI config, then retry
}
} Prevention
- Verify the PRD file path exists and is readable before calling
- Keep AI provider API keys and model config valid in the environment
- Validate numTasks and outputPath are sane before invocation
- Wrap calls so you inspect result.error.code rather than assuming success
- Retry on transient AI provider failures surfaced in the message
When it happens
Trigger: The core parsePRD() call at parse-prd.js:155 throws: PRD file missing/unreadable at inputPath, AI provider/API failure during task generation, invalid numTasks or outputPath, or any unhandled exception inside the core function.
Common situations: Calling the parse_prd MCP tool with a PRD path that doesn't exist; API key misconfiguration so the AI call fails; corrupted or empty PRD text file; permission errors writing tasks.json to outputPath.
Related errors
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/7cae4a1f4b409e48.
Report an issue: GitHub.