thisisalbe
08/16/2025, 2:42 AMAI Evy
08/16/2025, 2:42 AMAI Evy
08/16/2025, 2:43 AMjson
{
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "The city of the weather"
}
},
"required": [
"city"
]
}
**Important note**: Only include the parameters portion in the JSON schema field [(3) ]() . The function name and description should go in the separate form fields, not in the JSON schema .
When Retell calls your custom function, it will send a POST request with a JSON body containing [(2) ]() :
- `name`: the function name
- `call`: call object with context
- `args`: the arguments as a JSON object
For additional guidance on JSON schema format, you can refer to OpenAI's Function Calling Guide and Function Calling Tutorial [(1) ]() [(2) ]() .AI Evy
08/16/2025, 2:43 AMAI Evy
08/16/2025, 2:43 AMthisisalbe
08/16/2025, 2:49 AMAI Evy
08/16/2025, 2:49 AMAI Evy
08/16/2025, 2:49 AMargs parameter when your function is called [(1) ]() .
When Retell calls your custom function, it sends a request with this structure :
json
{
"name": "function_name",
"call": { /* call object for context */ },
"args": { /* the arguments as a JSON object */ }
}
The args object contains the variables that the LLM extracted from the conversation based on your JSON schema parameters . For example, if you defined a parameter for city in your JSON schema, and the user mentions "New York" during the conversation, Retell will automatically populate:
json
{
"name": "get_weather",
"call": { /* call context */ },
"args": {
"city": "New York"
}
}
The LLM handles the variable extraction and insertion automatically - you don't need to manually insert variables into the JSON body . You just need to define the parameter structure in your JSON schema, and Retell will populate the args with the appropriate values from the conversation .AI Evy
08/16/2025, 2:49 AMAI Evy
08/16/2025, 2:49 AM