Unable to Connect my Tool to my Agent
# support
j
I’m currently building a voice agent using the Agent Builder (not the Workflow Builder) and need help connecting it to a lead capture tool. My goal is to send three extracted variables — the caller’s name, phone number, and reason for calling — to a Make.com webhook. This webhook is set up to pass the data into a Google Sheet. The agent is successfully extracting the variables — I can see them clearly in the Data section of the call logs — but I’m unsure how to get those variables passed to the lead_capture tool so they can be sent to Make. I’ve created the webhook tool and formatted the JSON body correctly, and I’ve tested the Make scenario with “Run Once” enabled, but no data is coming through. Here’s where I’m stuck: Can an agent directly call a tool and pass those variables without needing to use the Workflow Builder? If yes, how and where should the tool call be structured so it triggers only after all three variables are captured? If not, is there an alternative method for sending these extracted values to Make? I’m open to any solution that helps achieve this. Thank you for your time and support!
v
Yes, you can pass extracted variables to a tool (like a webhook) from the Agent Builder by referencing dynamic variables in your tool's JSON body. Here's an example JSON body for your webhook tool:
Copy code
json
{
  "name": "{{name}}",
  "phone": "{{customer.number}}",
  "reason": "{{reason}}"
}
Make sure your agent's flow or prompt is set to call the tool after all variables are captured. If you need conditional logic (trigger only after all are present), you may need to guide the agent's prompt accordingly, as the Agent Builder does not natively support complex triggers like the Workflow Builder does. Sources: - [Custom Tools Guide](https://docs.vapi.ai/tools/custom-tools) - [Dynamic Variables](https://docs.vapi.ai/assistants/dynamic-variables)
a
responded you on email.