from llama_index.tools import FunctionTool def my_tool(input_str: str) -> str: """My tool description.""" return "Goodbye" # the function name and docstring are used as name and description # or, you can pass those params into from_defaults tool = FunctionTool.from_defaults(fn=my_tool)