https://retellai.com/?utm_source=discord&utm_medium=seo logo
why I cant save my JSON in my functions
# ❓・ai-evy-support
l
@AI Evy why I cant save my JSON in my functions
a
Thanks for tagging me @Lilkty. I'll look through relevant sources and get back to you shortly.
### Answer There are a couple of common reasons why your JSON schema might not save in custom functions: 1. Missing
"type": "object"
at the top level
One common mistake is not adding
"type": "object",
to the top level of the JSON schema. [(1) ]() [(2) ]() 2. Including function name/description in the JSON If you're including the function/tool name and description inside the JSON parameters field, that will cause issues. The name and description need to go in the separate form fields—only the parameters portion should go in the JSON parameters field. [(3) ]() Here's an example of a valid parameter schema:
Copy code
json
{
  "type": "object",
  "required": [
    "order_id"
  ],
  "properties": {
    "name": {
      "type": "object",
      "description": "",
      "properties": {
        "first_name": {
          "type": "string",
          "description": "User first name"
        },
        "last_name": {
          "type": "string",
          "const": "{{last_name}}"
        }
      }
    },
    "order_id": {
      "type": "number",
      "const": 1234
    }
  }
}
[(1) ]() [(2) ]() If you're still having trouble, try clicking one of the example templates in the dashboard and updating it accordingly.
​ 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] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[3] JSON Schema not saving in custom functions](https://discord.com/channels/1186424376300679209/1319363416296657039) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.