tool request format
# support
d
I am trying to make Tools work with my custom backend but the Vapi AI assistant doesn't seem to be giving a correct insights. I cannot find any details about the Tools request format. What is the assistant sending to the backend when it makes a Tools call.
v
@DaVenthus When the VAPI assistant makes a Tools call to your custom backend, it sends an HTTP request that contains information about the tool call. The request format typically includes the following: 1. **Tool Call Identifier**: A unique identifier for the tool call, which you can use to track the request and its corresponding response. 2. **Parameters**: Any parameters that are required for the tool to execute its function. These parameters are passed in the body of the request and are specific to the tool being called. Your server is expected to process this request, execute the desired function, and then send back a response in a JSON format. The response should look like this:
Copy code
json
{
    "results": [
        {
            "toolCallId": "X",
            "result": "Y"
        }
    ]
}
In this response: -
toolCallId
corresponds to the unique identifier of the tool call that was sent in the request. -
result
is the outcome of the tool execution, which can be data, a status message, or any other relevant information that the tool is designed to return. If you need more specific details about the request format or how to set up your backend to handle these requests, please ask support for more info on this.
You can continue this conversation by mentioning me in the message.
d
Also, can the "result" field be a json struct, or should it be a JSON string?
for payload check here: components > schemas> ServerMessageToolCalls https://api.vapi.ai/api-json#
7 Views