Agent doesn't end call.
# support
y
Hi, I've prompted the agent to do the following: ### Hanging Up: - In general, ask the customer if there is anything else I can help them with before hanging up. Remember to hang up after the conversation or request is complete. - When the conversation is complete, use the end call tool by calling the appropriate tool. However, it still doesn't end the calls properly. How can I make it end the calls after the conversation is complete?
v
Hi there! 👋 I see you're having trouble getting your Vapi agent to end calls properly. I'm unable to see your specific implementation details, but I can definitely help with how to properly implement the end call functionality in Vapi. Based on the information I have, here are several approaches to fix your end call issue: ## 1. Enable the endCall Function in Dashboard First, make sure you've enabled the endCall function in your Vapi dashboard: - Set
endCallFunctionEnabled
to true in your dashboard settings [Discord thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1313293840580612166) ## 2. Add the endCall Tool to Your Model's Tools Array The
endCall
function is a default tool in Vapi, but you need to explicitly add it to your model's tools array:
Copy code
javascript
// Make sure to include endCall in your tools array
const tools = [
  // Your other tools
  {
    name: "endCall",
    description: "Use this to end the call when the conversation is complete"
  }
];
According to the [Vapi default tools documentation](https://docs.vapi.ai/tools/default-tools), you "**need** to add these tools to your model's
tools
array." ## 3. Programmatically End the Call If the tool approach isn't working, you can programmatically end a call by sending an
end-call
message type:
Copy code
javascript
// Send an end-call message type
{
  type: "end-call"
}
This should be included when sending inbound messages to the client as mentioned in the [Vapi changelog](https://docs.vapi.ai/changelog/2025/1/14). ## 4. Check for Common Issues If you're still having problems, here are some common issues to check: - Ensure the exact function name is correct (Vapi needs the exact function name to trigger the
endCall
tool) - Check if Vapi-defined tools like
endCall
are being filtered out from your chat completions endpoint - Verify the function is being called with the correct parameters and at the right moment
- Review your logs for any error messages related to the end call function ## 5. Implement a Workaround for Filtered Tools If Vapi-built tools are being removed from the chat completions endpoint: - Include the
endCall
tool in your custom LLM tools - Send a "done stream" back to Vapi with the function name when the model requests it This workaround was suggested in a [Discord thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339871158975336498) for cases where the built-in tool isn't working. Is there anything specific about your implementation that you'd like me to help troubleshoot further? Sources: - [Discord thread about endCallFunctionEnabled](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1313293840580612166) - [Vapi default tools documentation](https://docs.vapi.ai/tools/default-tools) - [Vapi changelog](https://docs.vapi.ai/changelog/2025/1/14) - [Discord thread about filtered tools](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339871158975336498)
k
Was this idea helpful @yian
k
Hey! To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!
4 Views