adverse-sapphire
adverse-sapphire4h ago

Handoff tool not pass custom parameter to server

We are trying to build a dynamic agent that will first verify the user identity by a OTP, then it will route to another transient assistant that will change the settings based on the inputs from the handoff tool. The issue is that the handoff tool is called, the OTP parameter is not sent to the sever.
{
"type": "handoff",
"destinations": [
{
"type": "dynamic"
}
],
"function": {
"name": "handoff",
"description": "Call this function when the customer is ready to be handed off to the next assistant",
"parameters": {
"type": "object",
"properties": {
"destination": {
"type": "string",
"description": "Use dynamic when customer is ready to be handed off to the next assistant",
"enum": [
"dynamic"
]
},
"otp": {
"type": "number",
"description": "The OTP provided by the customer"
}
}
}
}
}
{
"type": "handoff",
"destinations": [
{
"type": "dynamic"
}
],
"function": {
"name": "handoff",
"description": "Call this function when the customer is ready to be handed off to the next assistant",
"parameters": {
"type": "object",
"properties": {
"destination": {
"type": "string",
"description": "Use dynamic when customer is ready to be handed off to the next assistant",
"enum": [
"dynamic"
]
},
"otp": {
"type": "number",
"description": "The OTP provided by the customer"
}
}
}
}
}
The call ID is e156ad94-175b-496e-8e13-f285cdfe3523 Thanks,
1 Reply
Vapi Support Bot
To ensure your OTP parameter is sent to the server, consider defining a custom tool instead of using the built-in handoff/transfer tool. Here’s a sample custom tool payload that will pass the OTP to your server:
{
"type": "function",
"function": {
"name": "handoffWithOtp",
"parameters": {
"type": "object",
"properties": {
"destination": { "type": "string" },
"otp": { "type": "number" }
}
}
},
"server": { "url": "https://your-server.com/handoff" }
}
{
"type": "function",
"function": {
"name": "handoffWithOtp",
"parameters": {
"type": "object",
"properties": {
"destination": { "type": "string" },
"otp": { "type": "number" }
}
}
},
"server": { "url": "https://your-server.com/handoff" }
}
Update your assistant to use this tool, and your server will receive the OTP in the payload.
For more, see the custom tools guide. Source: - Custom Tools
⤵️ Mention @Vapi Support Bot for follow-ups 🐥

Did you find this page helpful?