Understanding Tool payloads
# support
p
I have created a tool with an express endpoint as a server url (well, using ngrok for local development). The tool's purpose is simple - to save a message left by the caller. It has a single property "clientMessage". In the payload that is received there is a lot of data and to access the property I have to drill down with
req.body.message.toolCalls[0].function
This has the correct message:
Copy code
{
  name: 'saveClientMessage',
  arguments: { clientMessage: "David, I'll meet you tomorrow at 9." }
}
My question is - is the intended approach for accessing arguments sent in tool functions? As I mentioned, there is a lot of data in the payload and I couldn't see anywhere in the docs which described the shape of the payload and what is the intended way to access values of properties which come with tool calls.
k
Yes, accessing the tool function arguments through req.body.message.toolCalls\[0\].function is the correct approach for Vapi tool function calls. This path follows Vapi's payload structure for custom tool calls sent to your server URL