Step 2: Create a new tool

Then we need to define a new tool in GeoGebra to apply recursion.
In GeoGebra Classic 5, desktop version:

Create New Tool

Menu > Tools > Create Tool

On the pop out window

Output Objects > Select ListOutPut
Input Objects > Select original segment  Click on Next
Name the tool and command. Add help, if needed. Click on Finish to create tool.
In GeoGebra classic online version, or also GeoGebra 6 for desktop:

Access GeoGebra classic

On three-bar menu, top-right corner, select Create New Tool

Select Output Objects

Select Input Objects

Name your tool and click on Finish