In this guide you will build your first Tool: a simple function that queries the weather for a city and returns the temperature.
1
Create a new Tool
In the left panel of Brain Studio, go to the Tools tab and click to create a new Tool. Assign the name: Check Weather.
2
Drag an API node
On the canvas, drag an API node from the nodes panel. In the URL tab, enter:Under Variables, select or create an environment variable for your API key (mark it as secret if it contains credentials).
url.txt
3
Configure the inputs
In the Tool configuration, add an input:
- Name:
city - Type:
string - Required: Yes
{{$input.city}}).4
Configure the outputs
Define what information the Tool will return. In the outputs configuration, map:
temperature: Extract the value from the API responsedescription: Extract the weather description
5
Test your Tool
Use the testing functionality and enter a sample value, such as “Madrid”. Verify that the response is correct and that the outputs are mapped properly.
6
Publish the Tool
Click Publish. A version (v1.0.0) will be generated and it will become available for use in any project within your company.
city input.