{"record":{"id":"0332f5b42e3a5e9d","repo":"crewAIInc/crewAI","slug":"action-mkdir-requires-path","errorCode":null,"errorMessage":"action='mkdir' requires 'path'","messagePattern":"action='mkdir' requires 'path'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/daytona_sandbox_tool/daytona_file_tool.py","lineNumber":278,"sourceCode":"                if path is None:\n                    raise ValueError(\"action='write' requires 'path'\")\n                return self._write(sandbox, path, content or \"\", binary=binary)\n            if action == \"append\":\n                if path is None:\n                    raise ValueError(\"action='append' requires 'path'\")\n                return self._append(sandbox, path, content or \"\", binary=binary)\n            if action == \"list\":\n                if path is None:\n                    raise ValueError(\"action='list' requires 'path'\")\n                return self._list(sandbox, path)\n            if action == \"delete\":\n                if path is None:\n                    raise ValueError(\"action='delete' requires 'path'\")\n                sandbox.fs.delete_file(path, recursive=recursive)\n                return {\"status\": \"deleted\", \"path\": path}\n            if action == \"mkdir\":\n                if path is None:\n                    raise ValueError(\"action='mkdir' requires 'path'\")\n                mkdir_mode = mode or \"0755\"\n                sandbox.fs.create_folder(path, mkdir_mode)\n                return {\"status\": \"created\", \"path\": path, \"mode\": mkdir_mode}\n            if action == \"info\":\n                if path is None:\n                    raise ValueError(\"action='info' requires 'path'\")\n                return self._info(sandbox, path)\n            if action == \"exists\":\n                if path is None:\n                    raise ValueError(\"action='exists' requires 'path'\")\n                return self._exists(sandbox, path)\n            if action == \"move\":\n                if path is None or destination is None:\n                    raise ValueError(\"action='move' requires 'path' and 'destination'\")\n                sandbox.fs.move_files(path, destination)\n                return {\"status\": \"moved\", \"from\": path, \"to\": destination}\n            if action == \"find\":\n                if path is None or pattern is None:","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/daytona_sandbox_tool/daytona_file_tool.py#L260-L296","documentation":"DaytonaFileTool._run requires a 'path' argument when action='mkdir' so it knows which folder to create in the sandbox. If path is None the tool raises ValueError immediately instead of calling sandbox.fs.create_folder. An optional 'mode' argument (default '0755') is applied only after the path check passes. This is purely client-side input validation.","triggerScenarios":"Calling _run(action='mkdir') with no path, or supplying the folder name via 'destination' or 'name' instead of 'path'. An agent emitting {\"action\": \"mkdir\", \"mode\": \"0700\"} without a location.","commonSituations":"LLM tool calls that include the mode but drop the path; users assuming mkdir takes a 'directory' kwarg because other tools name it that; typos in the kwarg name.","solutions":["Pass the folder location as path: _run(action='mkdir', path='/data/scratch', mode='0755').","Refer to the tool's args_schema to confirm 'path' is the correct keyword for every action.","Pre-validate kwargs in a wrapper: if action == 'mkdir' assert path is not None.","Improve the tool description given to the agent so it always emits path."],"exampleFix":"# before\nfile_tool._run(action='mkdir', mode='0755')\n\n# after\nfile_tool._run(action='mkdir', path='/data/scratch', mode='0755')","handlingStrategy":"validation","validationCode":"if action == 'mkdir' and not kwargs.get('path'):\n    raise ValueError(\"action='mkdir' requires 'path'\")","typeGuard":null,"tryCatchPattern":"try:\n    file_tool._run(action='mkdir', **kwargs)\nexcept ValueError as e:\n    # argument error: fix kwargs and retry once with corrected input\n    handle_missing_argument('mkdir', 'path', e)","preventionTips":["Always pair an action verb with its target path in the same dict literal.","Test tool calls with a minimal smoke script before wiring them into agents.","Use the args_schema as the single source of truth for kwarg names."],"tags":["daytona","argument-validation","file-tool","mkdir"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}