FoundationAgents/OpenManus · error · ToolError

Parameter `file_text` is required for command: create

Error message

Parameter `file_text` is required for command: create

What it means

Error "Parameter `file_text` is required for command: create" thrown in FoundationAgents/OpenManus.

Source

Thrown at app/tool/str_replace_editor.py:138

        view_range: list[int] | None = None,
        old_str: str | None = None,
        new_str: str | None = None,
        insert_line: int | None = None,
        **kwargs: Any,
    ) -> str:
        """Execute a file operation command."""
        # Get the appropriate file operator
        operator = self._get_operator()

        # Validate path and command combination
        await self.validate_path(command, Path(path), operator)

        # Execute the appropriate command
        if command == "view":
            result = await self.view(path, view_range, operator)
        elif command == "create":
            if file_text is None:
                raise ToolError("Parameter `file_text` is required for command: create")
            await operator.write_file(path, file_text)
            self._file_history[path].append(file_text)
            result = ToolResult(output=f"File created successfully at: {path}")
        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":

View on GitHub (pinned to 52a13f2a57)

Solutions

  1. Pass the `file_text` parameter with the initial file contents when using command `create`.

When it happens

Trigger: Raised when the `create` command of str_replace_editor is called without the required `file_text` parameter.

Common situations: See trigger scenarios.


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