This quickstart contains two parts. This guide will use the Ultravox Web App but you can also use the Ultravox API if you prefer (not covered in this guide).

Using the Built-in hangUp Tool

1

Start with the Ultravox Console

Go to Agents.

2

Create a New Agent

Click on New Agent in the top right corner.

3

Enter a Name and Prompt

Copy & paste the following for the name of your agent:

Tools_Agent

Next, copy and paste this system prompt:

If the user says "Oklahoma" you must immediately call the 'hangUp' tool.
4

Add the hangUp Tool

Use the Tools drop-down and select the hangUp tool.

5

Save & Test the Agent

  • Save the agent using the Save button. This agent will be used in part two of this quickstart.

  • Start a call with your agent by clicking the Test Agent button on the bottom right.

  • When you say the word “Oklahoma”, the agent will call the tool and the call will end and you will see the call state change to DISCONNECTED.

Creating a Custom Tool

This part uses the Tools_Agent we created above in Using Built-in Tools.

1

Create the getAdvice Tool

Under Tools click on New Tool. Set properties as follows and then click on Save:

Tool Name:

getAdvice

Description:

This tool provides random advice.

Custom Endpoint URL:

api.adviceslip.com/advice
We are using the public adviceslip API as a quick example.
2

Edit Tools_Agent

  • Go to Agents
  • Click ... on the right side of our Tools_Agent
  • Choose Edit
3

Add the getAdvice Tool

Use the Tools drop-down and select the getAdvice tool. You can keep the hangUp tool selected.

4

Update Prompt

Copy & paste the following for the system prompt:

You are the world's best companion. You love talking to people.

If someone asks for or needs advice, you must use the 'getAdvice' tool. 
When you receive advice from the tool call, relay it back to the user.

If the user says "Oklahoma" you must immediately call the 'hangUp' tool.
5

Save & Test the Agent

  • Save the agent using the Save button.

  • Start a call with your agent by clicking the Test Agent button on the bottom right.

  • If you ask for advice, the agent will now use the tool to get random advice from the adviceslip API.

  • Saying “Oklahoma” will continue to trigger the hangUp tool.

Next Steps

  1. Learn more about Built-in Tools you can use.
  2. Dig into HTTP vs. Client Tools to understand the differences.
  3. Read about Durable vs. Temp Tools.