def build_error_tool_output(tool_name: str, tool_args: Any, err_msg: str) -> ToolOutput:
    """Build a ToolOutput for an error that has occurred."""
    return ToolOutput(
        content=err_msg,
        tool_name=tool_name,
        raw_input={"args": str(tool_args)},
        raw_output=err_msg,
        is_error=True,
    )
Build a ToolOutput for an error that has occurred.
llama-index-core/llama_index/core/agent/function_calling/step.py