Create tools
Creating and Using the tools
A tool is a function that an agent can use to carry out actions like calling external APIs or looking up information in a data source, as part of following the instructions defined in the prompt. We’ll use two tools: a built in tool to give the agent access to our data source with general weather information, and one to give the weather agent the ability to query the Open-Meteo API for real-time weather data, which we’ll need to create.
Click “Tools” on the left sidebar. This will take you to a list of the existing tools for your org. You’ll notice that there are many existing already - this is because Syllable comes with a standard set of tools out of the box and we add more tools for your AI agent all of the time. To create a new one, click “New tool” in the top-right corner.
- Name: The name of the tool is used to reference it elsewhere in Console, including in prompts and agents, so you should pick something that’s easily identifiable. It shouldn’t contain any whitespace. Enter “get_weather” here.
- Service: A service is a grouping of tools. You can select any available service here to add your new tool to that service. Select Default for now.
- Tool schema: A JSON object defining the behavior and capabilities of the tool. For this tool, you can paste the following:
Click Save on this tool.
Updating prompt to access tools
Now that we have our two tools, we can make them available to the prompt that we created earlier, so that any agents using that prompt will have access to the tools. We can do this on the prompt edit screen.
Navigate back to the Prompts screen, select your prompt and click Edit.
In the “Tools” dropdown, search for and add your new data_source_search
, get_weather
and get_current_datetime tool
as shown above.
- data_source_search - This is a built in tool that allows you to search a Data Source.
- get_current_datetime - This is a built in tool that gives the agent the ability to look up the time.
- get_weather - This is the tool that you made in the Create tools section of this tutorial
You also need to update the text of the prompt itself so that it informs the LLM when and how to use the new tools. Update it to match the following:
Now click Save to save the prompt.
We have one more step before we’re able to create the agent, and that’s to add a greeting message for the agent to deliver to the user at the beginning of a conversation. Click “Create a message” below to continue the tutorial.