{"record":{"id":"6e78ad9ea292ba7a","repo":"eyaltoledano/claude-task-master","slug":"missing-argument-6e78ad","errorCode":"MISSING_ARGUMENT","errorMessage":"tasksJsonPath is required","messagePattern":"tasksJsonPath is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/expand-all-tasks.js","lineNumber":58,"sourceCode":"\n\t// Create logger wrapper using the utility\n\tconst mcpLog = createLogWrapper(log);\n\n\t// Use provided complexity report path or compute it\n\tconst complexityReportPath =\n\t\tprovidedComplexityReportPath ||\n\t\tresolveComplexityReportOutputPath(null, { projectRoot, tag }, log);\n\n\tlog.info(\n\t\t`Expand all tasks will use complexity report at: ${complexityReportPath}`\n\t);\n\n\tif (!tasksJsonPath) {\n\t\tlog.error('expandAllTasksDirect 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\tenableSilentMode(); // Enable silent mode for the core function call\n\ttry {\n\t\tlog.info(\n\t\t\t`Calling core expandAllTasks with args: ${JSON.stringify({ num, research, prompt, force, projectRoot, tag })}`\n\t\t);\n\n\t\t// Parse parameters (ensure correct types)\n\t\tconst numSubtasks = num ? parseInt(num, 10) : undefined;\n\t\tconst useResearch = research === true;\n\t\tconst additionalContext = prompt || '';\n\t\tconst forceFlag = force === true;\n\n\t\t// Call the core function, passing options and the context object { session, mcpLog, projectRoot, tag, complexityReportPath }","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/expand-all-tasks.js#L40-L76","documentation":"expandAllTasksDirect requires tasksJsonPath to know which tasks file to expand. Missing or empty path triggers this MISSING_ARGUMENT structured error before silent mode is enabled or any core function runs.","triggerScenarios":"Invoking the expand_all MCP tool with no tasksJsonPath argument, or a custom MCP server whose path resolution (projectRoot/env) yields undefined; direct-function calls in scripts omitting the field.","commonSituations":"MCP server started outside the project so default path detection fails; renamed or relocated .taskmaster/tasks.json without updating config; automated pipelines constructing tool arguments programmatically and skipping optional-looking fields.","solutions":["Pass tasksJsonPath explicitly: { tasksJsonPath: '/repo/.taskmaster/tasks.json' }.","Restart the MCP server from the project root so path auto-resolution works.","Verify the tasks file exists at the expected location before calling.","Check server launch env/config (project root variables) that feed default path resolution."],"exampleFix":"// before\nawait expandAllTasksDirect({});\n// after\nawait expandAllTasksDirect({ tasksJsonPath: '/repo/.taskmaster/tasks.json' });","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nfunction assertExpandAllArgs(args) {\n  if (typeof args.tasksJsonPath !== 'string' || !fs.existsSync(args.tasksJsonPath)) {\n    throw new Error(`tasksJsonPath missing or file not found: ${args.tasksJsonPath}`);\n  }\n}","typeGuard":"function canExpandAll(a) {\n  return typeof a === 'object' && a !== null &&\n    typeof a.tasksJsonPath === 'string' && a.tasksJsonPath.length > 0;\n}","tryCatchPattern":"if (!canExpandAll(args)) {\n  return { success: false, error: { code: 'MISSING_ARGUMENT', message: 'tasksJsonPath is required' } };\n}\nconst res = await expandAllTasksDirect(args);","preventionTips":["Resolve the tasks file path from the project root once and reuse it for all tool calls.","Verify the file exists with fs.existsSync before batch operations.","Launch the MCP server with the correct working directory/environment.","Wrap direct-function calls in a helper that fills defaults for tasksJsonPath."],"tags":["mcp-server","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"}