I'm trying to dynamically create tools of type extract_dynamic_variable inside the general_tools field of an LLM using the endpoint:
PATCH
https://api.retellai.com/update-retell-llm/{llm_id}
Here’s an example of the body I’m sending:
{
"general_tools": [
{
"type": "extract_dynamic_variable",
"name": "extract_dynamic_test",
"description": "Extract the field test",
"variables": [
{
"type": "string",
"name": "test",
"description": "Test field",
}
]
}
]
}
However, the API responds with the following error:
{
"error_message": "request/body/general_tools/1/type must be equal to one of the allowed values: end_call,
request/body/general_tools/1/type must be equal to one of the allowed values: press_digit,
request/body/general_tools/1/type must be equal to one of the allowed values: mcp,
request/body/general_tools/1 must match exactly one schema in oneOf"
}
Endpoint: PATCH /update-retell-llm/{llm_id}
Auth: Bearer
Tested both via Node (fetch) and curl.
Other fields (like begin_message, voice_id, etc.) update correctly.
The issue only occurs when trying to add a tool with "type": "extract_dynamic_variable".
The documentation (
https://docs.retellai.com/api-references/create-retell-llm#option-7
) lists extract_dynamic_variable as a valid tool type, but it seems that the /update-retell-llm endpoint does not currently accept it.
Could you clarify:
1. What’s the correct way to create tools of type extract_dynamic_variable?
2. Can they be added via update-retell-llm, or do they have to be defined at LLM creation time?
3. Is there a valid JSON example of how this type of tool should be structured?