FoundationAgents/OpenManus · error · ToolError

Unrecognized command {command}. The allowed commands for the

Error message

Unrecognized command {command}. The allowed commands for the {self.name} tool are: {", ".join(get_args(Command))}

What it means

Error "Unrecognized command {command}. The allowed commands for the {self.name} tool are: {", ".join(get_args(Command))}" thrown in FoundationAgents/OpenManus.

Source

Thrown at app/tool/str_replace_editor.py:160

        elif command == "str_replace":
            if old_str is None:
                raise ToolError(
                    "Parameter `old_str` is required for command: str_replace"
                )
            result = await self.str_replace(path, old_str, new_str, operator)
        elif command == "insert":
            if insert_line is None:
                raise ToolError(
                    "Parameter `insert_line` is required for command: insert"
                )
            if new_str is None:
                raise ToolError("Parameter `new_str` is required for command: insert")
            result = await self.insert(path, insert_line, new_str, operator)
        elif command == "undo_edit":
            result = await self.undo_edit(path, operator)
        else:
            # This should be caught by type checking, but we include it for safety
            raise ToolError(
                f'Unrecognized command {command}. The allowed commands for the {self.name} tool are: {", ".join(get_args(Command))}'
            )

        return str(result)

    async def validate_path(
        self, command: str, path: Path, operator: FileOperator
    ) -> None:
        """Validate path and command combination based on execution environment."""
        # Check if path is absolute
        if not path.is_absolute():
            raise ToolError(f"The path {path} is not an absolute path")

        # Only check if path exists for non-create commands
        if command != "create":
            if not await operator.exists(path):
                raise ToolError(
                    f"The path {path} does not exist. Please provide a valid path."

View on GitHub (pinned to 52a13f2a57)

Solutions

  1. Use one of the allowed commands listed in the error message (view, create, str_replace, insert, undo_edit).
  2. Check for typos in the `command` parameter; it is case-sensitive.

When it happens

Trigger: Raised when str_replace_editor receives a command that is not one of the allowed Command values (view, create, str_replace, insert, undo_edit).

Common situations: See trigger scenarios.


AI-assisted analysis of FoundationAgents/OpenManus@52a13f2a57 (2026-08-15). Data as JSON: /api/errors/11a4c57fca372321. Report an issue: GitHub.