https://retellai.com/?utm_source=discord&utm_medium=seo logo
<@1145576664366055464> I’m making a function node ...
# ❓・ai-evy-support
m
@AI Evy I’m making a function node and typed my json schema code but I get parameter needs to be object error
a
Thanks for tagging me @myst.c. I'll look through relevant sources and get back to you shortly.
### Answer This is a common issue with custom function parameters in Retell AI. The error occurs because the JSON schema needs to have
"type": "object"
at the top level [(1) ]() [(2) ]() . One common mistake is not adding
"type": "object",
to the top level of the JSON schema . Here's the correct format for your parameter schema:
Copy code
javascript
{
  "type": "object",
  "properties": {
    "city": {
      "type": "string",
      "description": "The city of the weather"
    }
  },
  "required": [
    "city"
  ]
}
The key points to fix this error: 1. Ensure your JSON schema starts with
"type": "object"
2. Remove any unnecessary fields like
"$schema"
and
"title"
- they are not needed by Retell [(3) ]() 3. Follow the OpenAI Function Calling Guide format for parameter definitions [(1) ]() [(2) ]() If you're still having issues, try clicking one of the examples in the Retell dashboard and update accordingly . The parameters should be modeled off of the OpenAI function calling format, not a full JSON schema with metadata [(4) ]() .
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[3] Tool set up help request](https://discord.com/channels/1186424376300679209/1302850935160180756) [[4] custom function Error with VALID JSON Schema](https://discord.com/channels/1186424376300679209/1310169696582111274) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy if I add curly brackets to my variables in the equation transitions will this make a difference
a
Thanks for the follow-up, @myst.c. I'll get back to you soon.
### Answer Yes, adding curly brackets to your variables in equation transitions is required and will make a significant difference [(1) ]() . For equation conditions in Retell AI, you must use the double curly bracket format for dynamic variables . Here are the correct examples from the documentation:
Copy code
- {{user_age}} > 18
- {{current_time}} > 9 AND {{current_time}} < 18
- {{user_location}} == "New York"
- {{user_location}} != "New York"
- "New York, Los Angeles" CONTAINS {{user_location}}
- "New York, Los Angeles" NOT CONTAINS {{user_location}}
- {{user_age}} < 18 OR {{user_location}} == "New York"
The key requirement is that you can only use variables that are passed in as dynamic variables for equation conditions . If you need to use information extracted by the LLM during the call, you would need to use prompt conditions instead . Note that string comparisons (==, Contains, Not Contains, and Not Equal) do not require numerical input, while other comparison operators require numerical input and will always evaluate to false if the input is not a number .
​ To learn more, see the sources I considered: [[1] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.