Query tool not working
# support
f
I’m experiencing an issue with the Query Tool in Vapi AI. Previously, I was able to upload a .txt file as a knowledgebase, assign it to an AI assistant, and the assistant could read and use it without problems. However, recently this no longer works—the AI assistant cannot access or read the uploaded knowledgebase. Could you please advise on what might be causing this and how to resolve it? For reference: File type: .txt Steps I followed: i uploaded the text file to vapi ai, created a query tool, described it, assigned the knowledgebase (text file), i assign it to my assistant, when i request to use it, the tool fails and the ai cannot read and he gives me this notification when he tried to access the tool "Cannot read properties of undefined (reading 'message" The json code for example looks like this: { "id": "26e3fd95-ae66-4f66-ba3d-8d563f6a0b18", "createdAt": "2025-12-11T15:49:55.275Z", "updatedAt": "2025-12-11T15:51:24.875Z", "type": "query", "function": { "name": "query_tool", "description": "this is a tool used to answer FAQs", "parameters": { "type": "object", "properties": {}, "required": [] } }, "messages": [ { "type": "request-start", "blocking": false } ], "orgId": "c4bad15c-08a9-4947-97b2-267c898b3629", "knowledgeBases": [ { "name": "new_knowledge_base", "provider": "google", "model": "gemini-2.0-flash", "description": "this is a tool used to answer FAQs", "fileIds": [ "ba9e64e9-ce8b-4d57-9b3d-8028d86fd02f" ] } ] } The issue that i think is the blocking.
v
Actionable Fix: Update your assistant's system prompt to explicitly instruct when to use the query tool, naming it directly. For example:
Copy code
json
{
  "role": "system",
  "content": "When users ask about FAQs, use the 'query_tool' to search the knowledge base before answering."
}
This step is critical for the query tool to function properly and is the most common cause of failures like the one you described ([see 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)
v
Message marked as helpful by @FJ! 🎉
c
Let us know if you need additional assistance with your query tool/knowledge base
f
Works perfectly. Hope you have a great day
c
Glad you were able to get this resolved. We’ve closed this ticket, but your input is very valuable to us. Please take a moment to complete the survey, which should appear in a couple of days—your feedback directly helps us improve our support.