Sahil
04/08/2025, 6:30 AMVapi Support Bot
04/08/2025, 6:32 AMjavascript
const tool = {
type: "function",
async: false, // Set to false for synchronous execution
function: {
// your function definition
}
};
According to [Discord discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342315282198298729), setting tools to synchronous mode can help maintain sequential order.
### 2. Ensure Correct Response Formatting
The tool call response format is critical for sequential execution. Make sure your responses are:
- Strings without line breaks
- If using JSON, properly stringified
- Include the tool call ID in the response
As noted in [Discord discussions](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342315282198298729), incorrect formatting can prevent the next tool from triggering.
### 3. Server-Side Logic for Tool Chaining
Modify your server-side logic to trigger the next tool based on the current tool's result. Instead of simply returning a result, have your endpoint trigger the next tool call in the sequence according to [Vapi documentation](https://docs.vapi.ai/documentation/advanced-concepts/customization/custom-llm/custom-llm-tool-calling-integration).
### 4. Consider Using Make.com Integration
You could leverage Vapi's integration with Make.com to manage the workflow and trigger subsequent tools based on previous tool responses, as mentioned in [Vapi's documentation](https://docs.vapi.ai/tools/GHL).Vapi Support Bot
04/08/2025, 6:32 AMSahil
04/08/2025, 6:41 AMVapi Support Bot
04/08/2025, 6:42 AMjson
{
"results": [{
"toolCallId": "message.toolCalls[].id",
"result": "Your result data here"
}]
}
The correct formatting is crucial for Vapi to properly interpret the output and potentially trigger the next tool in the sequence.
#### 3. Managing Tool State and Flow
You'll need to maintain state between tool calls to track where you are in your sequence (validate_user_request → plan_user_request → judge_user_request_plan, etc.). This could be implemented as:
- A state machine on your server that tracks the current step
- A context object that's passed between tool calls
- Custom logic that determines the next step based on the output of the current step
#### 4. Consider Using Make.com as an Integration PointVapi Support Bot
04/08/2025, 6:42 AMVapi Support Bot
04/08/2025, 7:05 AMSahil
04/08/2025, 7:06 AMSahil
04/08/2025, 7:08 AMShubham Bajaj
04/08/2025, 7:36 PMSahil
04/09/2025, 5:02 AMShubham Bajaj
04/10/2025, 11:29 PM