worthy-azureW

How to pass assistant phone number to tool call?

I have an assistant that handles inbound calls from multiple phone numbers. When the call starts, I need the assistant to call my API to get organization info for the phone number that the customer called on.

I'm able to call my endpoint, but I'm having trouble passing the phone number that was called. It seems that the agent is not able to access that information.

Part of my prompt looks like this:
### Introduction  
1. Before you speak, fetch organization data with `getOrganizationData`, passing `{{assistant.number}}` as `calledNumber`, so the request body will look like this:

{
  "calledNumber": "{{assistant.number}}"
}


ChatGPT suggested using {{assistant.number}}, but apparently that's not a valid Vapi variable.

Is there another way that I can identify which phone number was called. Also, is there a place where we can see what Vapi variables are available? My fallback plan is to pass the callId, and then correlate that with a webhook event, but it doesn't seem to want to pass me {{call.id}} either.

I am able to pass {{caller.number}}, so at least some Vapi variables are working, but that doesn't help me much for this specific use case.

If I hardcode the number, the API call succeeds and returns data, so I know that everything about my configuration is correct, except for the passing of the called phone number.

Thanks for any info you can provide.
Was this page helpful?