https://retellai.com/?utm_source=discord&utm_medium=seo logo
how do I make an agent use a custom function I jus...
# ❓・ai-evy-support
k
@AI Evy how do I make an agent use a custom function I just created? It’s mentioned in the prompt but never used when it’s supposed to
a
Thanks for tagging me @K Rudy. I'll look through relevant sources and get back to you shortly.
### Answer To get your agent to actually use a custom function, you need to explicitly instruct it in the prompt when to invoke the function. Simply mentioning the function isn't enough—the LLM needs clear guidance on the trigger conditions. [(1) ]() Here's what to check: ## 1. Update your prompt with explicit instructions Add clear direction in your prompt about when to call the function. For example:
Copy code
When user provided the city name, please get the weather for that city by calling the `get_weather` function.
## 2. Verify your function configuration Make sure you've properly configured: - **Name**: Unique, underscore-separated (e.g.,
get_user_details
) - **Description**: Clear explanation of what the function does (e.g., "Get user details based on name and age") - **Parameters**: Valid JSON schema format—a common mistake is missing
"type": "object"
at the top level ## 3. Check speech behavior settings If you have "Speak After Execution" disabled, the agent may call the function but not verbally acknowledge it. Enable this setting so the agent tells the user the result after the function completes. ## 4. Test your endpoint Ensure your backend endpoint is reachable and returning a valid response (status code 200-299) . Failed requests will retry up to 2 times before timing out. Would you like help troubleshooting a specific part of your setup?
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
k
@AI Evy I just checked the call logs, is actually using and old funcion that I already removed from the prompt instead
a
Thanks for the follow-up, @K Rudy. I'll get back to you soon.
### Answer --- This sounds like a caching or version issue. Here are a few things to check: ## 1. Remove the function from the Tools section Removing a function from the prompt alone isn't enough—you also need to delete the function from the "Functions" section in the agent detail page in the Dashboard. [(1) ]() ## 2. Check if you're using Version Control If you're using agent versions, make sure you've deployed the updated version. Changes made in the builder won't affect live production calls until you hit the "Deployment" button to save a new version. [(2) ]() ## 3. Verify the correct agent is being used If you're making outbound calls via API, confirm you're using the correct
override_agent_id
parameter pointing to the updated agent. [(3) ]() ## 4. Test in the LLM Playground Use the LLM Playground in the dashboard to prototype and debug your agent prompts without making live calls—this can help confirm whether the old function is still being referenced. [(1) ]() If the old function is completely removed from both the prompt and the tools configuration, and you've deployed the latest version, the agent should stop using it. Can you confirm the function is removed from the Tools section as well?
​ To learn more, see the sources I considered: [[1] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) [[2] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[3] How can I create an outbound call](https://retell.discourse.group/t/how-can-i-create-an-outbound-call/132) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.