Issues with Tools Json
# support
m
I am trying to create a tool to have the AI transfer calls based on who the caller asks for even if I copy the transfercall code from the guide I always get this error:
Copy code
Invalid JSON Schema: {
  "_errors": [],
  "type": {
    "_errors": [
      "Invalid literal value, expected \"object\""
    ]
  },
  "properties": {
    "_errors": [
      "Required"
    ]
  }
}
v
Hi there! 👋 I see you're running into an "Invalid JSON Schema" error with your transferCall tool. Based on the error message, I can help you fix those specific issues with the "type" and "properties" fields. Looking at your error message, there are two main issues: 1. The "type" field is not set to "object" as expected 2. The "properties" field is missing or not correctly defined Here's how to fix these issues: For the
transferCall
tool, you need to structure your JSON schema correctly. The top-level
type
should be "transferCall", but within the
parameters
object, the
type
should be "object":
Copy code
json
{
  "type": "transferCall",
  "destinations": [
    {
      "type": "number",
      "number": "+16054440129"
    }
  ],
  "function": {
    "name": "transferCall",
    "description": "Use this function to transfer the call to the specified destination.",
    "parameters": {
      "type": "object",  // This is the important part - must be "object"
      "properties": {    // This field is required when type is "object"
        "destination": {
          "type": "string",
          "enum": [
            "+16054440129"
          ],
          "description": "The destination to transfer the call to."
        }
      },
      "required": [
        "destination"
      ],
      "additionalProperties": false  // Recommended for security
    }
  }
}
According to the [documentation I found](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1332319207936757815), each property in the JSON schema should have a "type" specified (like "string", "number", "boolean", etc.), and when the
type
is set to "object", the
properties
field must be defined. To debug this further, you can: 1. Use a JSON validator like jsonlint.com to check for formatting issues 2. Make sure all required fields are present in your schema 3. Ensure you're following the model-specific requirements (some models like Anthropic require keys to be alphanumeric only)
Is there anything else you'd like to know about setting up the transferCall tool? Sources: - [Discord Thread about transferCall type requirements](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1332319207936757815) - [Discord Thread about JSON Schema errors](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1332510949940133960) - [Discord Thread about transferCall JSON structure](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339930398473584650) - [Discord Thread about additionalProperties](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341487904677167114)
k
Hey! To help track down this issue, could you share: - The call/tool ID This would really help us figure out what went wrong!