FoundationAgents/OpenManus · error · ToolError

Parameter `insert_line` is required for command: insert

Error message

Parameter `insert_line` is required for command: insert

What it means

Error "Parameter `insert_line` is required for command: insert" thrown in FoundationAgents/OpenManus.

Source

Thrown at app/tool/str_replace_editor.py:150

        # 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":
            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:

View on GitHub (pinned to 52a13f2a57)

Solutions

  1. Pass the `insert_line` parameter (integer line number after which to insert) when using command `insert`.

When it happens

Trigger: Raised when the `insert` command is called without the required `insert_line` parameter.

Common situations: See trigger scenarios.


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