{"record":{"id":"42e185cff42d5795","repo":"eyaltoledano/claude-task-master","slug":"missing-argument-42e185","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/list-tags.js","lineNumber":43,"sourceCode":"\t// Destructure expected args\n\tconst { tasksJsonPath, showMetadata = false, projectRoot } = 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('listTagsDirect 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\tlog.info('Listing all tags');\n\n\t\t// Prepare options\n\t\tconst options = {\n\t\t\tshowMetadata\n\t\t};\n\n\t\t// Call the tags function\n\t\tconst result = await tags(\n\t\t\ttasksJsonPath,\n\t\t\toptions,\n\t\t\t{\n\t\t\t\tsession,","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/list-tags.js#L25-L61","documentation":"listTagsDirect requires tasksJsonPath because listing tags reads the tag map stored in tasks.json. When the argument is falsy it logs the failure, disables silent mode, and returns a MISSING_ARGUMENT error result before attempting any file access.","triggerScenarios":"Calling the list_tags MCP tool without tasksJsonPath (or passing null/empty string).","commonSituations":"Client wrappers assuming tags are global rather than per-file; configs forwarding only projectRoot; API drift after tasksJsonPath became mandatory for tag operations.","solutions":["Pass tasksJsonPath: <projectRoot>/.taskmaster/tasks/tasks.json in the call","Resolve the path from projectRoot if the caller only knows the root","Update client tool-call code so the argument is always forwarded"],"exampleFix":"// before\nawait mcp.call('list_tags', {});\n// after\nawait mcp.call('list_tags', { tasksJsonPath: '/repo/.taskmaster/tasks/tasks.json' });","handlingStrategy":"validation","validationCode":"import path from 'path';\nfunction assertTasksJsonPath(args) {\n  if (typeof args.tasksJsonPath !== 'string' || args.tasksJsonPath === '') {\n    args.tasksJsonPath = path.join(args.projectRoot ?? '', '.taskmaster', 'tasks', 'tasks.json');\n  }\n  if (args.tasksJsonPath === '' || args.tasksJsonPath === '/.taskmaster/tasks/tasks.json') {\n    throw new Error('Cannot derive tasksJsonPath: provide projectRoot or tasksJsonPath');\n  }\n  return args;\n}","typeGuard":"function hasTasksJsonPath(args) {\n  return typeof args?.tasksJsonPath === 'string' && args.tasksJsonPath.length > 0;\n}","tryCatchPattern":"const res = await callTool('list_tags', { tasksJsonPath });\nif (!res.success && res.error?.code === 'MISSING_ARGUMENT') {\n  console.error('list_tags requires tasksJsonPath; pass <root>/.taskmaster/tasks/tasks.json');\n}","preventionTips":["Centralize a callTool wrapper that supplies tasksJsonPath for all tag/task tools","Derive the path from projectRoot once at startup","Add argument-presence assertions in client code before MCP dispatch","Keep client tool-call code in sync with current MCP tool schemas"],"tags":["mcp","missing-argument","tags"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}