Tutorial on Your First Tool
In this tutorial, you'll create a tool using HALO to retrieve energy usage data for Dutch households. Please see the assignment below for more details. Try completing the task yourself before consulting the answers in the step-by-step guide provided.
Good luck!
Assignment
Create a tool using HALO to retrieve energy usage data for Dutch households based on a zipcode and house number. Leverage the Assistant for code completion to clean up the zipcode parameter by removing blanks to ensure data accuracy. The tool accesses energy consumption information via an open API (https://commondatafactory.nl/docs/api/energie).
API Details: Use the endpoint 'https://ds.vboenergie.commondatafactory.nl/list/?match-postcode=[ZIPCODE]&match-huisnummer=[HOUSENUMBER]
', replacing [ZIPCODE]
and [HOUSENUMBER]
with the correct parameters.
Steps-by-Step Guide
Initiate Tool Creation
Go to the Tools section in HALO.
Click the blue plus sign and select ‘Add New Tool’.
Name the tool “Retrieve Energy Data Dutch Households”.
Set the description as “Accessing government data through an open API.”
Set Up Parameters
In the ‘Start’ block, add two parameters:
Zipcode: Set as a String data type and include a description.
House Number: Set as a String data type with a description.

Clean Up Zipcode Input
Add a step to clean up the input for the zipcode using the Assistant.
Click the plus sign and instruct the Assistant to “Remove Blank Spaces from Zipcode”.


The Assistant will create a step with Python code.
API Configuration
Create the next step for the API call:
HTTP Method: Set to "GET".
API URL: '
https://ds.vboenergie.commondatafactory.nl/list/?match-postcode=[ZIPCODE]&match-huisnummer=[HOUSENUMBER]
’Replace parameters:
For
[ZIPCODE]
, selectcleaned_zipcode
via the menu by typing '/'.For
[HOUSENUMBER]
, choosehousenumber
.

Output Verification
Verify that the API call results are stored correctly in the
result
variable.

Save the Tool
Don’t forget to save the tool!

Testing the Tool
Use the play button at the bottom to test the tool.
Input “19” for the house number.
Format the zipcode with a space: "4811 AN", and click ‘Run & Debug.’
Confirm successful test execution by checking green marks at each step.
Utilize arrows in the top right to review the steps. Note the initial and cleaned zipcode formats.

Save Tool
After a successful test, click save to store the tool.
Conclusion
Congratulations on your first Tool! In the next tutorial, you will learn how to build an AI agent utilizing this tool, enhancing your agent's capabilities!