query_tool not working
# support
r
@User @User @User I am using a query tool and have verified that the file IDs are valid and the files are successfully uploaded. The knowledge base description is clear, and the tool is properly attached to the assistant. This setup was working correctly until recently. tool response throws this error result "Unexpected token '<', \"<!DOCTYPE \"... is not valid JSON"
v
Your error indicates the webhook is returning HTML (like an error page) instead of valid JSON. Make sure your webhook always returns a JSON response with HTTP 200 status, even for errors. Here’s the required format:
Copy code
json
{
  "results": [
    {
      "toolCallId": "call_123",
      "result": "Your response as a single-line string"
    }
  ]
}
Double-check your endpoint and response structure to resolve the issue. For more details, see the [Vapi custom tools troubleshooting guide](https://docs.vapi.ai/tools/custom-tools-troubleshooting). Source: - [Custom tools troubleshooting](https://docs.vapi.ai/tools/custom-tools-troubleshooting)
r
@Sahil @Sam @Vapi Support Bot @VAPI Tech please help me get out of this?
v
Action Step: Double-check your assistant's system prompt to ensure it explicitly instructs the assistant to use your query tool by its exact function name (e.g.,
'product-query'
). For example:
Copy code
json
{
  "role": "system",
  "content": "When users ask about products or troubleshooting, use the 'product-query' tool to search the knowledge base before answering."
}
Update and save your prompt, then retest the query tool. For more details, see the [query tool documentation](https://docs.vapi.ai/knowledge-base/using-query-tool). Source: - [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)
r
@Vapi Support Bot already checked system prompt is fine as added same name but error is still same, not for 1 assistant. for every assistant that have knowledge base tool, throws this error, today this issue is coming, recently it was working fine
v
Next Action: Check your call logs for detailed error messages and ensure your webhook endpoint always returns a valid JSON response with HTTP 200 statusβ€”even for errors. The required format is:
Copy code
json
{
  "results": [
    {
      "toolCallId": "call_123",
      "result": "Your response as a single-line string"
    }
  ]
}
Review your server's response and logs to identify any HTML or non-JSON output, and adjust your handler accordingly. See the [custom tools troubleshooting guide](https://docs.vapi.ai/tools/custom-tools-troubleshooting) for more details. Source: - [Custom tools troubleshooting](https://docs.vapi.ai/tools/custom-tools-troubleshooting)
s
should be fixed now
v
Message marked as helpful by @Marin (mainnet fking arc) (❖,❖)! πŸŽ‰
m
Nothing helpful
c
This issue s resolved, can you check now?
m
Ok
Still going wrong
c
can you share the call_id?
m
Most probably the problem it’s in the query tool LLM provider itself. Like the Google gemeni itself is broken
I’ll share imediatly
SI every guy is having this issue. Go to the integration tab and select google and add your API KEY from Google cloud, if you don’t have one just create a Google key account and add it. Also enable the Gemeni API IN your Google cloud account.
@Sahil
c
h
@sahil even I have the same problem and all the details are given here: https://vapi.ai/community/m/1463533337699287124 Multiple users have been affected. We would very much appreciate an acknowledgment and an ETA for the fix.
c
Hashrin, we are hitting the rate limit and we are trying to get higher limit as soon as possible. We have added it in our status page as well https://status.vapi.ai/incident/809181