https://retellai.com/?utm_source=discord&utm_medium=seo logo
<@1145576664366055464> when I create an agent with...
# ❓・ai-evy-support
h
@AI Evy when I create an agent with general_tools, I get this error: request/body/general_tools/1/type must be equal to one of the allowed values: end_call Mine is a custom tool
a
Thanks for tagging me @hello_14019. I'll look through relevant sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [End call]() * [LLM WebSocket]() * [Integrate Function Calling]() * [Setup WebSocket Server]() -----------------------------
### Answer From the documentation, custom functions need to be added through the dashboard interface, not through general_tools [(1)]() . To add a custom function: 1. Click "+ Add" in the tools section and select "Custom Function" from the dropdown menu 2. Configure the function name, description, endpoint URL and parameters For general_tools, only the end_call type is shown in the documentation [(2)]() . Here's an example of a valid general_tools configuration:
Copy code
typescript
general_tools=[
    {
        "type": "end_call",
        "name": "end_call",
        "description":
            "End the call with user only when user explicitly requests it",
    },
],
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
@AI Evy how can I add custom tools via an API then?
a
Thanks for the follow-up, @hello_14019. I'll get back to you soon.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Integrate any system with custom function]() * [LLM WebSocket]() * [Overview]() * [Platform Changelogs | Retell AI]() -----------------------------
### Answer Based on the information sources, when creating a custom tool, you need to: 1. Define JSON schema parameters for your tool [(1)]() 2. The schema should specify the structure of data you want to send For example, if you want to collect data like name, phone, email and reason, your JSON schema would look like:
Copy code
json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "phone": {
      "type": "string"
    },
    "email": {
      "type": "string"
    },
    "reason": {
      "type": "string"
    }
  },
  "required": [
    "name",
    "phone",
    "email",
    "reason"
  ]
}
Note that when Retell sends the request to your webhook, it will include both the call information and the arguments you defined in the schema . One important note: If you hit the custom tool API again for the same tool, it will replace the existing tool even if you change the name [(2)]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
no, I meant in the create agent endpoint of API, can I include a custom tool?
@AI Evy no, I meant in the create agent endpoint of API, can I include a custom tool?
a
Thanks for the follow-up, @hello_14019. I'll get back to you soon.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Create Agent]() * [Integrate any system with custom function]() * [LLM WebSocket]() * [Overview]() -----------------------------
### Answer I apologize, but I don't see explicit documentation showing how to include custom tools in the create agent API endpoint. While the documentation shows that custom tools exist [(1)]() and can be configured through the dashboard [(2)]() , there isn't clear documentation about adding them via the API endpoint directly. The documentation only explicitly shows that pre-defined tools like end_call, transfer_call, press_digits, check_availability and book_calendar are available as built-in tools [(1)]() . For the most accurate guidance, I'd recommend checking the Retell AI Discord or documentation for updates on this functionality.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.