{"record":{"id":"30da0792c4905d8b","repo":"eyaltoledano/claude-task-master","slug":"missing-argument-30da07","errorCode":"MISSING_ARGUMENT","errorMessage":"tasksJsonPath is required","messagePattern":"tasksJsonPath is required","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/validate-dependencies.js","lineNumber":30,"sourceCode":"/**\n * Validate dependencies in tasks.json\n * @param {Object} args - Function arguments\n * @param {string} args.tasksJsonPath - Explicit path to the tasks.json file.\n * @param {string} args.projectRoot - Project root path (for MCP/env fallback)\n * @param {string} args.tag - Tag for the task (optional)\n * @param {Object} log - Logger object\n * @returns {Promise<{success: boolean, data?: Object, error?: {code: string, message: string}}>}\n */\nexport async function validateDependenciesDirect(args, log) {\n\t// Destructure the explicit tasksJsonPath\n\tconst { tasksJsonPath, projectRoot, tag } = args;\n\n\tif (!tasksJsonPath) {\n\t\tlog.error('validateDependenciesDirect called without tasksJsonPath');\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\tcode: 'MISSING_ARGUMENT',\n\t\t\t\tmessage: 'tasksJsonPath is required'\n\t\t\t}\n\t\t};\n\t}\n\n\ttry {\n\t\tlog.info(`Validating dependencies in tasks: ${tasksJsonPath}`);\n\n\t\t// Use the provided tasksJsonPath\n\t\tconst tasksPath = tasksJsonPath;\n\n\t\t// Verify the file exists\n\t\tif (!fs.existsSync(tasksPath)) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'FILE_NOT_FOUND',\n\t\t\t\t\tmessage: `Tasks file not found at ${tasksPath}`","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/validate-dependencies.js#L12-L48","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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)"],"exampleFix":"// before\nawait validateDependenciesDirect({});\n// after\nawait validateDependenciesDirect({ tasksJsonPath: '/project/.taskmaster/tasks.json' });","handlingStrategy":"validation","validationCode":"function assertValidateArgs(args) {\n  if (!args?.tasksJsonPath || typeof args.tasksJsonPath !== 'string') {\n    throw new Error('tasksJsonPath is required to validate dependencies');\n  }\n}","typeGuard":"function isValidatableArgs(a): a is { tasksJsonPath: string } & Record<string, unknown> {\n  return typeof a === 'object' && a !== null && typeof (a as any).tasksJsonPath === 'string';\n}","tryCatchPattern":"const res = await validateDependenciesDirect(args); // returns structured error, never throws\nif (!res.success) {\n  if (res.error?.code === 'MISSING_ARGUMENT') { /* supply tasksJsonPath */ }\n}","preventionTips":["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"],"tags":["mcp","missing-argument","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}