Skip to navigation

Hang Up tool quickstart

Create an assistant that answers a question and ends the call when the caller is done

Use this quickstart to create and test an assistant that ends a call with the Hang Up tool.

What you’ll build

An assistant for the Vapi hardware store that answers a caller’s question about opening hours. When the caller has nothing else to ask, the assistant calls the Hang Up tool, says goodbye, and ends the call.

Prerequisites

1. Create the Hang Up tool

1

Create the tool

Open the Dashboard, select Tools, select Create Tool, then choose Hang Up.

2

Configure the tool

Under Tool Settings, enter the following values:

FieldValue
Tool NameendCall
DescriptionEnds the call. Use only after the caller confirms they have nothing else to ask.

Replace the default name, end_call_tool, with endCall. The system prompt refers to the tool by this name.

Vapi Dashboard Tool Settings with Tool Name endCall and a description
Name and describe the Hang Up tool
3

Add the goodbye

Expand Messages. Under Request Start, set Message Option to Custom and enter Thanks for calling. Goodbye.

Vapi Dashboard Messages section with a Request Start message set to Custom: Thanks for calling. Goodbye.
Set a custom Request Start goodbye
4

Publish the tool

Select Publish, review the changes, select Next, then select Publish.

2. Create the assistant

Use this system prompt in either method:

System prompt
You are a friendly assistant for the Vapi hardware store.
Store hours:
- Monday to Friday: 8 AM to 6 PM
- Saturday: 9 AM to 5 PM
- Sunday: closed
Answer the caller's questions about store hours. If they ask about anything else, say you can only help with store hours.
After you answer, ask whether they need anything else. If they say no, call the endCall tool. Do not say goodbye yourself; the tool says it.
Do not end the call when the caller asks a follow-up question, asks you to wait, or asks you to repeat something.
1

Create a blank assistant

Select Assistants, then select Create Assistant.

2

Configure the assistant

Set Name to Vapi Hardware Store and First Message to:

First message
Thanks for calling the Vapi hardware store. How can I help you?

Replace System Prompt with the prompt above.

3

Attach the tool

Open the Tools tab, select Add tool, then choose endCall.

Vapi Dashboard assistant Tools tab listing the endCall tool
The Hang Up tool attached to the assistant
4

Publish the assistant

Select Publish, review the changes, then select Quick Publish.

3. Talk to the assistant

In the Dashboard, open the Vapi Hardware Store assistant and select Talk.

  1. Ask when the store opens on Saturday.
  2. When the assistant asks whether you need anything else, ask whether it is open on Sunday.
  3. When it asks again, say no.

The assistant should answer both questions and stay on the call after your follow-up. After you say no, it should say “Thanks for calling. Goodbye.” and end the call.

4. Check how the call ended

Select Logs, then open the call. See Call logs. The ended reason should be assistant-ended-call. Through the API, check endedReason on the call.

Next steps