Tafting
05/27/2025, 1:01 AM{
"role": "tool_call_result",
"time": 1748306984938,
"result": "Here is the result of the tool call: {\"template\":\"bold\",\"fontFamily\":\"Montserrat\",\"fontWeight\":\"800\",\"fontSize\":60,\"color\":\"#ffffff\",\"isItalic\":false,\"isPunctuation\":true,\"isUppercase\":true,\"mode\":\"twoLines\",\"position\":50,\"animation\":{\"appear\":\"bounce\"},\"activeWord\":{\"isActive\":true,\"fontFamily\":\"Montserrat\",\"fontWeight\":\"800\",\"fontSize\":62,\"color\":\"#bbbbbb\",\"isItalic\":false,\"isPunctuation\":true,\"isUppercase\":true},\"shadow\":{\"isActive\":true,\"size\":3,\"color\":\"#000000\"}}",
"secondsFromStart": 13.552
}
{
"name": "getCurrentSubtitleStyle",
"role": "tool_call_result",
"time": 1748306985490,
"result": "No result returned.",
"toolCallId": "call_wQxdakrO15NNScvqwngijnCu",
"secondsFromStart": 10.06
}
`
code:
if (message.type === "tool-calls" && props?.onToolCall && Array.isArray(message.toolCalls)) {
message.toolCalls.forEach(async (toolCall: any) => {
const result = await props.onToolCall?.(toolCall);
if (vapiInstance) {
vapiInstance.send({
type: "add-message",
message: {
role: "tool",
content: "Here is the result of the tool call: " + result
}
});
}
});
}
Is there a way to do this? Because I'm almost done, but the reponse tool seems to be possible only on the server side, but I'm obliged to use it on the client side for these data and actions.Kings_big💫
05/27/2025, 6:53 AMVapi Support Bot
05/27/2025, 6:54 AMjson
{
"results": [
{
"toolCallId": "call_wQxdakrO15NNScvqwngijnCu",
"result": "Your result here"
}
]
}
There is no documented way to send a tool response with toolCallId
from the client that the assistant will process as a tool result.
[See: Vapi Custom Tools Guide](https://docs.vapi.ai/tools/custom-tools)
Sources:
- [Vapi Custom Tools Guide](https://docs.vapi.ai/tools/custom-tools)
- [Vapi Web SDK](https://docs.vapi.ai/sdk/web)Tafting
05/27/2025, 4:49 PMvapiInstance.send({
type: "add-message",
message: {
role: "tool_call_result",
toolCallId: toolCall.id || toolCall.toolCallId,
name: toolCall.function?.name || toolCall.name,
content: result
}
});
incoming-webhook failed validation. Errors: [ "message.property toolCallId should not exist", "message.property name should not exist", "message.role must be one of the following values: assistant, function, user, system, tool" ]
I have the impression that on the client side I can't put the toolCallId and the name, which is a pity.
Could I technically do this by calling the vapi api on the server side, perhaps?Vapi Support Bot
05/27/2025, 4:52 PMtoolCallId
) directly from the client in Vapi.
To resolve a tool call, you must send the result from your server using the following format:
json
{
"results": [
{
"toolCallId": "call_wQxdakrO15NNScvqwngijnCu",
"result": "Your result here"
}
]
}
If you need to process the tool on the client, send the result to your server first, then have your server forward it to Vapi in this format.
[See: Vapi Custom Tools Guide](https://docs.vapi.ai/tools/custom-tools)
Sources:
- [Vapi Custom Tools Guide](https://docs.vapi.ai/tools/custom-tools)
- [Vapi Web SDK](https://docs.vapi.ai/sdk/web)Sahil
05/27/2025, 5:51 PMVapi Support Bot
05/27/2025, 5:52 PMtoolCallId
directly from the client in Vapi.
To resolve a tool call, send the result from your server using this format:
json
{
"results": [
{
"toolCallId": "call_wQxdakrO15NNScvqwngijnCu",
"result": "Your result here"
}
]
}
If you process the tool on the client, forward the result to your server, then have your server send it to Vapi in this format.
[See: Vapi Custom Tools Guide](https://docs.vapi.ai/tools/custom-tools)
Sources:
- [Vapi Custom Tools Guide](https://docs.vapi.ai/tools/custom-tools)
- [Vapi Web SDK](https://docs.vapi.ai/sdk/web)