https://retellai.com/?utm_source=discord&utm_medium=seo logo
hi, need help~, how can I make a function call li...
# ❓・ai-evy-support
g
@AI Evy hi, need help~, how can I make a function call like this in my prompt. How can I fix this issue? thanks! it's not working now https://cdn.discordapp.com/attachments/1302816169367044149/1405968423233519726/image.png?ex=68a0c1a1&is=689f7021&hm=82daaf7a62001cf1d17f9413f91ccbaa831cbf3f8a05e45f93ff51e142767e96&
a
Thanks for tagging me @Guo. I'll look through relevant sources and get back to you shortly.
### Answer For function calling to work properly in your prompt, you need to explicitly include instructions about when to invoke the function [(1) ]() . Here's how to set this up: In your prompt, include specific trigger conditions:
Copy code
When user provided the city name, please get the weather for that city by calling the `get_weather` function.
For MCP tools, use similar explicit instructions:
Copy code
When user states his name and phone number, please call tool `verify_user` function.
[(2) ]() Common troubleshooting steps: 1. Check your function configuration - Ensure your custom function has the correct name, description, and parameters defined in the dashboard [(1) ]() 2. Verify your JSON schema - A common mistake is not adding
"type": "object",
to the top level of the JSON schema 3. Update your prompt - It's best to include in the prompt explicitly when is the best time to invoke the custom function If your functions still aren't triggering, this appears to be a known issue that other users have experienced [(3) ]() . The LLM intelligently decides when to call functions by outputting structured JSON objects containing the necessary arguments [(4) ]() , but sometimes the trigger conditions need to be more specific in your prompt. **
​ 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] MCP](https://docs.retellai.com/build/single-multi-prompt/mcp) [[3] Function Calls are not triggered](https://discord.com/channels/1186424376300679209/1270747287278321735) [[4] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
Yeah, I did this , like my screenshot provided in my prompt When user started talking, please extract the information by calling the
get_meta_data
function.