query tool problem
# support
t
hello, i keep having this problem when using the vapi knowledge tool. the query tool is configured correctly- it has descriptions and knowledge bases with uploaded files, the assistant has that tool assigned, and the prompt specifies that that tool should be called when asking specific questions. any feedback please? https://cdn.discordapp.com/attachments/1443601265102950472/1443601265409003561/Screenshot_2025-11-27_at_15.51.05.png?ex=6940bc32&is=693f6ab2&hm=5130943db27a8acfd031df2e4e38867ca2db811680c1d1a2db9bdf3144d7edf7&
v
Try this: Go to your Vapi dashboard, navigate to Tools > theMarketer_query_tool, and use the Test button to send a sample query. This will help you see if the error persists and provide more detailed feedback in the tool execution section. If the error appears here, check that your knowledge base name and file IDs match exactly in your configuration. This quick test will pinpoint if the issue is with the tool setup or the assistant integration. Sources: - [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool) - [Custom tools troubleshooting](https://docs.vapi.ai/tools/custom-tools-troubleshooting) - [Debugging voice agents](https://docs.vapi.ai/debugging)
@Vapi Support Bot
v
Thank you for the details. Since you only see file names (not file IDs) and the "Test" button is missing, could you confirm if you created the knowledge base and attached files using the Dashboard or the API? This will help determine if there’s a configuration mismatch or a UI limitation. Tip: According to the documentation, file IDs are used in the backend even if only file names are shown in the UI. If you used the API, double-check that the correct file IDs are referenced. If you used the dashboard, the system should handle this automatically, but a UI update or bug could be affecting your experience. Let me know which method you used! Sources: - [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool) - [Custom tools troubleshooting](https://docs.vapi.ai/tools/custom-tools-troubleshooting)
t
i assigned the files using the dashboard. - i created a query_tool, created a knowledge base in it in which i assigned a specific file. on the agent, i assigned that tool in the tools section and told the prompt to use it when necessary but i keep getting that message - Cannot read properties of undefined (reading 'message')
@Vapi Support Bot
v
Suggestion: Double-check that your assistant's system prompt uses the exact function name of your query tool (e.g.,
theMarketer_query_tool
) when instructing the assistant to call it. For example, your prompt should include a line like:
Copy code
When users ask about our platform, use the 'theMarketer_query_tool' to search the knowledge base.
This explicit naming is required for the tool to trigger correctly and avoid undefined property errors, as highlighted in the documentation. Source: - [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool)
t
it does, and i see the assistant is calling the right tool - theMarketer_query_tool { "knowledgeBaseNames": [ "despre_si_de_ce_noi_kb" ] } but the tool response is always this Tool Response call_bTzzM70QE5jRSeL7x5LSyytD Response Data Cannot read properties of undefined (reading 'message') @Vapi Support Bot
v
Try re-selecting and saving your knowledge base files: Go to your query tool in the dashboard, deselect all files from the knowledge base, save, then re-select the correct files and save again. This can refresh the backend file mapping and often resolves "Cannot read properties of undefined (reading 'message')" errors caused by hidden file ID mismatches. After updating, test the assistant again to see if the error persists. 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)
t
i did that already and the problem is the same @Vapi Support Bot
v
Thank you for confirming your previous steps. To help diagnose further, could you please check the Call Logs in your Vapi dashboard (under
Observe > Call Logs
) and let me know if there are any additional error details or stack traces shown for the failed tool call? This information can help pinpoint where the issue is occurring in the backend. If you see any specific error messages or codes in the logs, please share them here. Sources: - [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool) - [Custom tools troubleshooting](https://docs.vapi.ai/tools/custom-tools-troubleshooting) - [Debugging voice agents](https://docs.vapi.ai/debugging)
t
no other information - only "Cannot read properties of undefined (reading 'message') " @Vapi Support Bot
v
Thank you for confirming your previous steps. To help isolate the issue further, could you please try removing the entire knowledge base from the query tool, saving, then re-adding it with the desired files and saving again? Sometimes a full removal and re-attachment can resolve hidden backend mapping issues that re-selecting files alone does not fix, as suggested in the documentation. Let me know if the error persists after this process. Sources: - [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool) - [Custom tools troubleshooting](https://docs.vapi.ai/tools/custom-tools-troubleshooting)
t
did that already as well @Vapi Support Bot
v
Thank you for confirming all the previous steps. To help narrow this down: Have you tried creating an entirely new query tool and knowledge base (with a different name), uploading one of your files again, and testing if the error still occurs with this fresh setup? This can help determine if the issue is related to a hidden configuration problem in the original tool or knowledge base. If you have already tried this, please let me know! Sources: - [Using the Query Tool for Knowledge Bases](https://docs.vapi.ai/knowledge-base/using-query-tool) - [Custom tools troubleshooting](https://docs.vapi.ai/tools/custom-tools-troubleshooting)
t
i just did that and i have the same problem @Vapi Support Bot
v
Thank you for confirming all previous steps. To help pinpoint the issue, could you let me know if you have any custom webhook integrations or advanced configurations set up for this tool, or is everything managed solely through the Vapi dashboard? Source: - [Custom tools troubleshooting](https://docs.vapi.ai/tools/custom-tools-troubleshooting)
t
none. only one other slack tool integration @Vapi Support Bot
v
Suggestion: Check if your tool's response is returning a single-line string in the required JSON format, as line breaks or malformed JSON can cause the "Cannot read properties of undefined (reading 'message')" error. The correct format should look like this:
Copy code
json
{
  "results": [
    {
      "toolCallId": "call_123",
      "result": "Your response as single-line string"
    }
  ]
}
If you are only using the dashboard, contact Vapi support with this error and reference the [Custom tools troubleshooting guide](https://docs.vapi.ai/tools/custom-tools-troubleshooting) for further backend investigation. Source: - [Custom tools troubleshooting](https://docs.vapi.ai/tools/custom-tools-troubleshooting)
t
i just noticed that in the call, it works. in the call logs. up untill now i was testing in the chat . in the chat it still does not work but in the call it works. why @Vapi Support Bot
v
Thank you for sharing this update. Based on the information I have found, there is no explanation provided for why the query tool works during calls but not in chat. The documentation and troubleshooting steps address general configuration and backend mapping issues, but do not mention differences in behavior between chat and call modes. If you have already confirmed that the tool is configured correctly and works in calls, but not in chat, this specific scenario is not covered in the available information. If any new details become available, I will be happy to share them.
t
Hi Vapi Support Team, I hope you’re doing well. I’m facing a critical issue with my Vapi AI assistant while using the RAG (query) tool and uploaded files as the knowledge base. Even though I have added files to the knowledge base and configured the RAG tool properly, the assistant is not using the knowledge base at all. When the assistant triggers the query tool, I consistently receive the following response: {"knowledgeBaseNames": ["company_details_numecent"]} Tool Response: Cannot read properties of undefined (reading 'mess...) Response Data: Cannot read properties of undefined (reading 'message') Because of this, the query tool never returns results, and the assistant fails to use RAG for answers. I am unable to resolve this from my side, and the error appears to be internal to the query tool or its integration. Could you please look into this urgently and guide me on how to fix it? If needed, I can share screenshots, or my assistant configuration as well.
same for me
c
Hi Tudor DUmitrescu, To configure the Query Tool for knowledge bases, you can follow these steps: 1. **Upload Your Files**: Use either the dashboard or the API to upload files. You will need the file IDs for the next steps. 2. **Create a Query Tool**: - **Dashboard**: Go to Tools, click Create Tool, select Query, and configure it with your knowledge base files and a descriptive name and description. - **API**: Use the provided API request format to create the tool with your file IDs and descriptions. 3. **Attach the Query Tool to Your Assistant**: - **Dashboard**: Go to Assistants, select your assistant, add the query tool, update the system prompt with clear instructions on when to use the tool. - **API**: Use the PATCH request format to attach the tool by updating the assistant's model. For full instructions, including code samples, refer to the [query tool documentation](https://docs.vapi.ai/knowledge-base/using-query-tool). If you encounter any issues, you can check if they align with the known issues or configurations.
t
already did all that. and it does not work for the chat option. only for the call. as i already said 4 times both here and via your support email.
c
Hi, Thanks for the details — this is a known bug with the Query Tool in chat. There isn’t an ETA on a fix yet, but our team is actively working on it. If you’re seeing similar issues when using the Query Tool during calls, please share a call ID and we can review the logs on our side. Best, Vapi Support