{"record":{"id":"0c2b8c0b91f3a69c","repo":"eyaltoledano/claude-task-master","slug":"missing-argument-0c2b8c","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/add-tag.js","lineNumber":58,"sourceCode":"\t\tprojectRoot\n\t} = args;\n\tconst { session } = context;\n\n\t// Enable silent mode to prevent console logs from interfering with JSON response\n\tenableSilentMode();\n\n\t// Create logger wrapper using the utility\n\tconst mcpLog = createLogWrapper(log);\n\n\ttry {\n\t\t// Check if tasksJsonPath was provided\n\t\tif (!tasksJsonPath) {\n\t\t\tlog.error('addTagDirect called without tasksJsonPath');\n\t\t\tdisableSilentMode();\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'MISSING_ARGUMENT',\n\t\t\t\t\tmessage: 'tasksJsonPath is required'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t// Handle --from-branch option\n\t\tif (fromBranch) {\n\t\t\tlog.info('Creating tag from current git branch');\n\n\t\t\t// Import git utilities\n\t\t\tconst gitUtils = await import(\n\t\t\t\t'../../../../scripts/modules/utils/git-utils.js'\n\t\t\t);\n\n\t\t\t// Check if we're in a git repository\n\t\t\tif (!(await gitUtils.isGitRepository(projectRoot))) {\n\t\t\t\tlog.error('Not in a git repository');\n\t\t\t\tdisableSilentMode();","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/add-tag.js#L40-L76","documentation":"addTagDirect refuses to run when the tasksJsonPath argument is missing or empty. This is a guard at the top of the MCP direct function because every tag operation needs to know where .taskmaster/config.json (or tasks.json) lives. It returns a structured error object with code MISSING_ARGUMENT instead of throwing.","triggerScenarios":"Calling the add_tag MCP tool without the tasksJsonPath parameter, or passing an empty string/undefined for it from the tool caller.","commonSituations":"MCP client tool schema out of sync with server version; a wrapper script dropping arguments; hand-crafted tool calls omitting required fields.","solutions":["Pass the absolute path to your .taskmaster/tasks.json (or project .taskmaster/config.json) as tasksJsonPath in the tool call","Regenerate/refresh the MCP client's tool schema so tasksJsonPath is included as a required argument","Check the tool invocation payload for typos in the argument name (e.g. tasksPath vs tasksJsonPath)"],"exampleFix":"// before\nadd_tag({ name: 'release-1' });\n// after\nadd_tag({ tasksJsonPath: '/project/.taskmaster/tasks.json', name: 'release-1' });","handlingStrategy":"validation","validationCode":"const tasksJsonPath = args?.tasksJsonPath;\nif (!tasksJsonPath || typeof tasksJsonPath !== 'string') {\n  throw new Error('add_tag requires a non-empty tasksJsonPath string');\n}","typeGuard":"function hasTasksJsonPath(a) {\n  return typeof a === 'object' && a !== null && typeof a.tasksJsonPath === 'string' && a.tasksJsonPath.length > 0;\n}","tryCatchPattern":"try {\n  const res = await addTagDirect(args);\n  if (!res.success && res.error?.code === 'MISSING_ARGUMENT') { /* prompt for tasksJsonPath */ }\n} catch (e) { /* unexpected transport failure */ }","preventionTips":["Always resolve the absolute .taskmaster path before MCP tool calls","Keep the MCP client tool schema in sync with server version","Validate tool arguments with a schema (zod/ajv) before dispatch"],"tags":["mcp","argument-validation","configuration"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}