{"record":{"id":"aeed95d2f2d96ac2","repo":"crewAIInc/crewAI","slug":"unknown-action-action-aeed95","errorCode":null,"errorMessage":"Unknown action: {action}","messagePattern":"Unknown action: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/e2b_sandbox_tool/e2b_file_tool.py","lineNumber":117,"sourceCode":"            if action == \"read\":\n                return self._read(sandbox, path, binary=binary)\n            if action == \"write\":\n                return self._write(sandbox, path, content or \"\", binary=binary)\n            if action == \"append\":\n                return self._append(sandbox, path, content or \"\", binary=binary)\n            if action == \"list\":\n                return self._list(sandbox, path, depth=depth)\n            if action == \"delete\":\n                sandbox.files.remove(path)\n                return {\"status\": \"deleted\", \"path\": path}\n            if action == \"mkdir\":\n                created = sandbox.files.make_dir(path)\n                return {\"status\": \"created\", \"path\": path, \"created\": bool(created)}\n            if action == \"info\":\n                return self._info(sandbox, path)\n            if action == \"exists\":\n                return {\"path\": path, \"exists\": bool(sandbox.files.exists(path))}\n            raise ValueError(f\"Unknown action: {action}\")\n        finally:\n            self._release_sandbox(sandbox, should_kill)\n\n    def _read(self, sandbox: Any, path: str, *, binary: bool) -> dict[str, Any]:\n        if binary:\n            data: bytes = sandbox.files.read(path, format=\"bytes\")\n            return {\n                \"path\": path,\n                \"encoding\": \"base64\",\n                \"content\": base64.b64encode(data).decode(\"ascii\"),\n            }\n        try:\n            content: str = sandbox.files.read(path)\n            return {\"path\": path, \"encoding\": \"utf-8\", \"content\": content}\n        except UnicodeDecodeError:\n            data = sandbox.files.read(path, format=\"bytes\")\n            return {\n                \"path\": path,","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/e2b_sandbox_tool/e2b_file_tool.py#L99-L135","documentation":"Raised by E2BFileTool._run when the 'action' string does not match any of the handled cases (read, write, append, list, delete, mkdir, info, exists). It is the final else-branch after the if/elif chain over known actions, so any typo'd or unsupported action name reaches it.","triggerScenarios":"Passing action='remove' or action='copy' (not supported), a typo like action='lst' or 'Write', or a differently-cased action such as 'READ' — matching is case-sensitive exact string comparison.","commonSituations":"An LLM agent invents an action not in the tool's description; callers upgraded from an older version where action names differed; locale/case confusion in generated tool args.","solutions":["Use one of the supported actions exactly: 'read', 'write', 'append', 'list', 'delete', 'mkdir', 'info', 'exists' (check the schema description for the canonical list).","If you need 'remove', the supported equivalent is action='delete'.","Validate the action string in your own code before invoking the tool (see defense below)."],"exampleFix":"# before\ntool._run(action='remove', path='/tmp/x.txt')\n\n# after\ntool._run(action='delete', path='/tmp/x.txt')","handlingStrategy":"validation","validationCode":"E2B_FILE_ACTIONS = {'read','write','append','list','delete','mkdir','info','exists'}\nassert action in E2B_FILE_ACTIONS, f'action must be one of {sorted(E2B_FILE_ACTIONS)}'","typeGuard":"def is_e2b_file_action(a: str) -> bool:\n    return a in {'read','write','append','list','delete','mkdir','info','exists'}","tryCatchPattern":"try:\n    result = tool._run(action=action, path=path)\nexcept ValueError as e:\n    if 'Unknown action' in str(e):\n        action = 'delete' if action == 'remove' else action  # map or re-raise\n    else:\n        raise","preventionTips":["Keep the supported action set in one constant shared with your agent's prompt.","Tell the LLM the exact enum of actions in the task description."],"tags":["e2b","validation","tool-args","dispatch"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}