Custom tools troubleshooting
Overview
Troubleshoot and fix common issues with custom tool integrations in your Vapi assistants.
In this guide, you’ll learn to:
- Diagnose why tools aren’t triggering
- Fix response format errors
- Resolve parameter and token issues
- Handle multiple tool scenarios
Quick diagnosis
Start with the most common issue for your symptoms:
Symptoms: Assistant doesn’t call your tool Check prompting and schema setup
Symptoms: Logs show “no result returned” Fix response format issues
Symptoms: Tool returns data but assistant ignores it Resolve parsing and format problems
Symptoms: Tool parameters or responses truncated Increase token limits
Tool won’t trigger
Your assistant doesn’t call the tool even when it should.
Check your assistant prompting
Use the exact tool name in your assistant instructions. If your tool is named
get_weather
, reference get_weather
in prompts, not weather_tool
.
Verify required parameters
Check that your tool schema includes all required parameters:
Enable schema validation
Add strict: true
to catch validation errors early:
Check your call logs for “Schema validation errors” to identify parameter issues.
No result returned error
Logs show “ok, no result returned” or similar messages.
Use the correct response format
Your webhook must return this exact JSON structure:
Common format mistakes
Wrong HTTP status code
Always return HTTP 200, even for errors. Any other status code is ignored completely.
Line breaks in response
Use single-line strings only. Line breaks cause parsing errors.
Missing results array
The response must have the results
array structure. Individual result objects won’t work.
Tool call ID mismatch
The toolCallId
in your response must exactly match the ID from the request.
Wrong result data type
Both result
and error
fields must be strings, not objects or arrays.
Response ignored
Tool returns data but the assistant doesn’t use it in conversation.
Fix line breaks and formatting
Verify HTTP status and JSON structure
Token truncation
Tool parameters or responses are getting cut off.
Increase token limits
The default token limit is only 100. Increase it for complex tools:
Look for “Token truncation warnings” in your call logs to identify when this occurs.
Multiple tools scenarios
Some tools in parallel calls fail or return wrong results.
Handle multiple tool responses
Return all results in the same order as the calls were triggered:
Use HTTP 200 for the entire response, even if some individual tools error.
Handle errors within the results
array using the error
field.
Async vs sync behavior
Tool behavior doesn’t match your expectations.
Sync tools (recommended)
Async tools
Configuration: "async": false
(default)
Behavior:
- Wait for webhook response before resolving
- Tool call resolution depends on your response
- Use for immediate operations
Most tools should use sync behavior unless you specifically need async processing for long-running operations.
Reference: Required formats
Response format template
Tool schema template
Critical response rules
\n
line breaksDebugging with call logs
Look for these key error messages in your call logs: