Custom Tool in VAPI
# support
s
I’m trying to setup a tool in my vapi assistant to extract a phone number from a conversation. I have a single parameter for phone number set as required. The issue I’m having is when I try to test the tool, the parameter doesn’t show up in the request body and it’s not editable so I can’t add it. Additionally, when I send a request to my external api, I get a network error. However, when I send a request from Postman or a Curl command to the same API I get a successful response… Any idea why this is happening?
c
Set
"strict": true
with
"phone"
as a required top-level parameter, update prompts to extract it, check vapi webhook logs, ensure your API is publicly accessible, or use
vapi listen
to tunnel locally..
s
Copy code
{
  "id": "9df4ceea-530b-4335-aaf7-65dd5f9ef5d4",
  "createdAt": "2025-07-02T22:03:24.602Z",
  "updatedAt": "2025-07-08T16:04:58.438Z",
  "type": "function",
  "function": {
    "name": "Extract_phone_number",
    "strict": true,
    "description": "Extract and validate a phone number from the conversation.",
    "parameters": {
      "type": "object",
      "properties": {
        "phone_number": {
          "description": "a valid phone number in e164 format like +1 (230)-123-2432.",
          "type": "string"
        }
      },
      "required": [
        "phone_number"
      ]
    }
  },
  "messages": [
    {
      "type": "request-start",
      "content": "Phone number verification in progress.",
      "blocking": false
    },
    {
      "role": "assistant",
      "type": "request-complete",
      "content": "Phone number successfully verified.",
      "endCallAfterSpokenEnabled": false
    },
    {
      "type": "request-failed",
      "content": "Phone number could not be successfully verified, are you sure you entered the correct number?",
      "endCallAfterSpokenEnabled": false
    }
  ],
  "orgId": "bd02dcc8-b25e-4d56-ad1e-17a2c3d01f04",
  "server": {
    "url": "https://carefinder.ai/api/phone-validate",
    "headers": {
      "Content-Type": "application/json"
    }
  }
}
I set it to true, phone_number is required and Im still not seeing it in the test tool
@KINGS BIG
did you see this?
k
Your config is correct, send you call_id
s
I dont know what you mean by call_id? The issue im having is with the tool. It doesnt work and even the test doesnt work. Why isn't the required field populating in the request body of the test tool.? Why do I get a network error when I try to test it, but it works when I send a cURL or when I send it from postman? Im not sure how call_id is important here. This is the tool_id: 9df4ceea-530b-4335-aaf7-65dd5f9ef5d4 If you want a call_id here is one: d635e527-10a2-408e-9349-5bdedbc754a1 The issue is the phone number is supposed to get verified by the tool, but it's not working.
I think i just realized you wanted the tool call id which is: call_sPU9aZGbiDBXKlciu78PePXU
I have made some progress, the issue was related to my api endpoint not processing the req body correctly. Now I am having an issue sending a response back to VAPI. No matter what I put in the body of the response I keep getting an error like this: { "name": "Extract_phone_number", "role": "tool_call_result", "time": 1752105423817, "result": "No result returned.", "toolCallId": "call_k46KTx05BASpnfdaH2VYlfg5", "secondsFromStart": 49.045 } I have tried several different bodies such as : { "phone_number": "2066186280" } { "result": "+12066186280" } { "result": { "status": "success", "message": "Phone number validated successfully", "phone_number": "+1 (206)-618-6280" } } { "status": "success", "message": "Phone number validated successfully", "phone_number": "+12066186280" } And none of these seem to work. I can't find a place to define my response. Can you help me?
c
You need to return the tool call response according to the following format, and it will work for you. If even after fix out the correct format, it still breaks for you, you can check out this troubleshooting guide:
s
OK that worked thanks!
c
Hey Sasha, I'm marking this ticket as solved. If you need anything else, just let me know.
3 Views