https://retellai.com/?utm_source=discord&utm_medium=seo logo
In Functions, how "required
# ❓・ai-evy-support
c
@AI Evy In Functions, how "required! field word for parameter, does it mean the AI agent must fill it in or does it mean this field will always appear as parmeter but can be left empty by AI agent if not provided?
a
Thanks for tagging me @confident_monkey_18928. I'll look through relevant sources and get back to you shortly.
### Answer When you mark a parameter as "required" in a function definition, it means the AI agent must provide a value for that parameter when calling the function [(1) ]() . The parameter cannot be left empty or omitted. Looking at the example schema structure from the documentation :
Copy code
json
{
  "type": "object",
  "properties": {
    "customer_id": {
      "type": "string",
      "description": "The customer ID to check"
    },
    "phone_number": {
      "type": "string", 
      "description": "Customer phone number"
    }
  },
  "required": ["customer_id"]
}
[(2) ]() In this example,
customer_id
is in the "required" array, which means the AI agent must extract and provide a value for this parameter when calling the function . If the agent cannot determine the required parameter value from the conversation, it should ask the user for that information before making the function call [(3) ]() . Parameters not listed in the "required" array are optional and can be omitted by the AI agent if the information isn't available or relevant to the specific function call [(1) ]() .
​ 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] When I am calling the agent is not responding](https://discord.com/channels/1186424376300679209/1402701293633667252) [[3] 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.