eyaltoledano/claude-task-master · error
MISSING_ARGUMENT
MISSING_ARGUMENT
Error message
tasksJsonPath is required
What it means
validateDependenciesDirect is the MCP wrapper that checks a tasks.json file for dependency cycles and issues. It requires tasksJsonPath to know which file to validate; without it, it returns MISSING_ARGUMENT before attempting any file access.
Source
Thrown at mcp-server/src/core/direct-functions/validate-dependencies.js:30
/**
* Validate dependencies in tasks.json
* @param {Object} args - Function arguments
* @param {string} args.tasksJsonPath - Explicit path to the tasks.json file.
* @param {string} args.projectRoot - Project root path (for MCP/env fallback)
* @param {string} args.tag - Tag for the task (optional)
* @param {Object} log - Logger object
* @returns {Promise<{success: boolean, data?: Object, error?: {code: string, message: string}}>}
*/
export async function validateDependenciesDirect(args, log) {
// Destructure the explicit tasksJsonPath
const { tasksJsonPath, projectRoot, tag } = args;
if (!tasksJsonPath) {
log.error('validateDependenciesDirect called without tasksJsonPath');
return {
success: false,
error: {
code: 'MISSING_ARGUMENT',
message: 'tasksJsonPath is required'
}
};
}
try {
log.info(`Validating dependencies in tasks: ${tasksJsonPath}`);
// Use the provided tasksJsonPath
const tasksPath = tasksJsonPath;
// Verify the file exists
if (!fs.existsSync(tasksPath)) {
return {
success: false,
error: {
code: 'FILE_NOT_FOUND',
message: `Tasks file not found at ${tasksPath}`View on GitHub (pinned to c0c98d367c)
Solutions
- Pass tasksJsonPath (absolute path to tasks.json) in the arguments
- Default the path from the project root in the tool handler when absent
- Verify the argument key spelling matches the tool schema (tasksJsonPath, not tasksPath)
Example fix
// before
await validateDependenciesDirect({});
// after
await validateDependenciesDirect({ tasksJsonPath: '/project/.taskmaster/tasks.json' }); Defensive patterns
Strategy: validation
Validate before calling
function assertValidateArgs(args) {
if (!args?.tasksJsonPath || typeof args.tasksJsonPath !== 'string') {
throw new Error('tasksJsonPath is required to validate dependencies');
}
} Type guard
function isValidatableArgs(a): a is { tasksJsonPath: string } & Record<string, unknown> {
return typeof a === 'object' && a !== null && typeof (a as any).tasksJsonPath === 'string';
} Try / catch
const res = await validateDependenciesDirect(args); // returns structured error, never throws
if (!res.success) {
if (res.error?.code === 'MISSING_ARGUMENT') { /* supply tasksJsonPath */ }
} Prevention
- Pass absolute tasksJsonPath resolved from workspace root
- Check the tool schema's exact parameter name before invoking
- Wrap direct-function calls in a helper that injects the default tasks path
When it happens
Trigger: Invoking the validate-dependencies MCP tool without tasksJsonPath, e.g. tool handler does not resolve the project's tasks.json path or client drops the argument.
Common situations: MCP client config not pointing at the workspace; custom scripts calling the direct function with only options like fix=true; refactor renamed the parameter so old callers pass the wrong key.
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/30da0792c4905d8b.
Report an issue: GitHub.