Dynamic Transfer Tool in Squad for Transfer to Age...
# support
t
I have two agents leasing and maintenance and one dynamic transfer tool (no destinations) with webhook setup to get the destinations from our backend. The webhook is working fine, but I am unable to get the name of the agent the tool is transferring to in the "argument" param.
v
To include the agent's name in the transfer tool's arguments, ensure your webhook response adds a custom field (e.g.,
agentName
) to the destination object. For example:
Copy code
json
{
  "destination": {
    "type": "assistant",
    "assistantName": "LeasingAgent",
    "description": "Leasing department agent",
    "agentName": "LeasingAgent"
  }
}
Your assistant or downstream logic can then extract
agentName
from the destination object. Adjust your webhook to include this field as needed for your use case. Reference: See [Dynamic call transfers - webhook response example](https://docs.vapi.ai/calls/call-dynamic-transfers#build-your-webhook-server). Source: - [Dynamic call transfers](https://docs.vapi.ai/calls/call-dynamic-transfers#build-your-webhook-server)
v
I can help you fix that. It seems your webhook works fine, but the agent name isn’t being passed in the argument field. Could you share how your backend returns the destination data? That’ll help me see where the mapping might be missing. @Toph
c
Hi Toph, To implement a dynamic call transfer using Vapi, ensure the following steps are followed: 1. **Create a Dynamic Transfer Tool**:Leave the
destinations
array empty, and specify the tool type as
transferCall
. Here's a basic structure:
Copy code
json
   { 
     "type": "transferCall", 
     "destinations": [], 
     "function": {
       "name": "dynamicTransfer",
       "description": "Transfer call to appropriate destination based on customer needs",
       "parameters": {
         "type": "object",
         "properties": {
           "reason": {"type": "string", "description": "Reason for transfer"},
           "urgency": {"type": "string", "enum": ["low", "medium", "high", "critical"]}
         }
       }
     }
   }
2. **Webhook Setup**:Use a
transfer-destination-request
webhook to dynamically determine the transfer destination. Make sure your server logic correctly interprets the context from the webhook and responds with the appropriate destination. 3. **Assistant Configuration**:Integrate your dynamic transfer tool into an assistant configuration, enabling the transfer-destination-request server event to activate dynamic routing. 4. **Testing**:Assign the created assistant with the dynamic transfer tool to a phone number. Test various transfer scenarios and monitor the webhook server logs to verify the routing decisions are being made correctly. For complete procedural steps, you can refer to the [Dynamic Transfers](https://docs.vapi.ai/calls/call-dynamic-transfers) documentation.
t
Issue is the transfer-destination-request don't get trigger when something passed to argument like
Copy code
{
"role": "tool_calls",
"time": 1760507944804,
"message": "",
"toolCalls": [
"0": {
"id": "call_ss4HeJAoN0XPqv1UiGUemtUK",
"type": "function",
"function": {
"name": "transfer_call_tool",
"arguments": "{\"target\": \"maintenance agent\"}"
}
}
],
"secondsFromStart": 5.524
}

{
"name": "transfer_call_tool",
"role": "tool_call_result",
"time": 1760507944809,
"result": "Transfer initiated.",
"toolCallId": "call_ss4HeJAoN0XPqv1UiGUemtUK",
"secondsFromStart": 5.529
}
https://cdn.discordapp.com/attachments/1427326515502383104/1427899555424370769/image.png?ex=68f08a97&is=68ef3917&hm=16e4f0c94b3bd2be6b3d4345a5128b7edb9e3a2227a000800506878b17b73fa0&
@Shubham Bajaj @Kings_big💫 Please look into this, I am not even getting any reply on vapi support email as well.
In case if something is not passed in the arguments object then it does trigger the webhook
Copy code
{
"role": "tool_calls",
"time": 1760508283304,
"message": "",
"toolCalls": [
"0": {
"id": "call_i3KnxUjfIfcCxeuemdhfvnWI",
"type": "function",
"function": {
"name": "transfer_call_tool",
"arguments": "{}"
}
}
],
"secondsFromStart": 14.395
}

{
"name": "transfer_call_tool",
"role": "tool_call_result",
"time": 1760508283748,
"result": "Invalid transfer target or agent not found",
"toolCallId": "call_i3KnxUjfIfcCxeuemdhfvnWI",
"secondsFromStart": 14.839
}
but issue is I want to pass something into the arguments object without that how would I know what to transfer.
@Vapi no one is helping @Vapi Support Bot
c
Hey there, we reviewed the details of your request and brought this to our team's attention. We will be getting back to you as soon as we can. Thank you for your continued patience!
2 Views