https://retellai.com/?utm_source=discord&utm_medium=seo logo
custom function is not triggering in the chat agen...
# ❓・ai-evy-support
d
@AI Evy custom function is not triggering in the chat agent even the prompt is written to trigger the function.
a
Thanks for tagging me @dzei. I'll look through relevant sources and get back to you shortly.
### Answer --- There are a few things to check when custom functions aren't triggering in a chat agent: 1. Verify function configuration: - Ensure the function name is unique and uses underscores (e.g.,
get_user_details
) . [(1) ]() - The description should clearly explain when the LLM should call it. - Make sure your endpoint URL is valid. 2. Check parameter definitions: - For POST, PATCH, and PUT requests, parameters must be defined using JSON schema format. 3. Prompt clarity: - The LLM decides when to call functions based on the description you provide. Make the function description explicit about the trigger conditions. [(2) ]() 4. Known issues: - There was a past incident where conversation flow agents stayed silent after a function node due to a message order issue. This was resolved, but similar edge cases may occur. [(3) ]() - Some users have reported functions not consistently triggering during calls—sometimes only the first function fires. [(4) ]() Troubleshooting steps: 1. Test the function in the LLM Playground first 2. Verify your endpoint is receiving requests (check server logs) 3. Confirm headers and query parameters are set correctly if required [(1) ]() If the issue persists, could you share: - The function name and description you've configured? - Whether the endpoint receives any requests at all?
​ 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) [[2] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) [[3] Conversation Flow agent potentially stay silent after function node](https://retell.discourse.group/t/conversation-flow-agent-potentially-stay-silent-after-function-node/135) [[4] Custom Functions Not Consistently Triggering During Phone Calls](https://discord.com/channels/1186424376300679209/1306003379964612638) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy the endpoint does not receive any request. it is because the chat agent does not invocate the custom function
a
Thanks for the follow-up, @dzei. I'll get back to you soon.
### Answer If your endpoint is not receiving any requests, the LLM is not deciding to invoke the function. Here are key things to check: 1. Update your prompt to explicitly instruct when to call the function: [(1) ]()
Copy code
When user provided the city name, please get the weather for that city by calling the `get_weather` function.
The prompt should clearly state the trigger condition for your specific function. 2. Verify function description: The LLM uses the function description to decide when to call it. Make sure the description clearly explains the purpose and when it should be invoked. 3. Check parameter schema validity: If you failed to save the custom function, it is likely because the parameters are not valid. One common mistake is not adding
"type": "object",
to the top level of the JSON schema. 4. Publish your agent: One user reported that functions worked in test chat but not in actual calls—the solution was to publish the agent and ensure the correct version was selected. [(2) ]() 5. Test in LLM Playground: Use the LLM Playground in the dashboard to prototype and debug your agent prompts without making live calls. Could you share: - Your function name and description? - The prompt instruction you're using to trigger it? This will help identify if the LLM isn't recognizing when to call the function.
​ 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) [[2] Retell does not send full custom function to webhook](https://discord.com/channels/1186424376300679209/1426299918208733215) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.