Ability to debug tool call via toolCallId`
# support
j
Hi team, Is there a way to debug a toolcall via the toolCallId? We've had multiple instances when the agent calls a query tool to retrieve data, eg "checkup". Occasionally, this will not return any data. All we can see from the call logs are the knowledge based queried:
{"knowledgeBaseNames":["clinic_appointment_type"]}
with the following response:
"result": " No answer found in the knowledge base\n"
In instances of the tool call working/not working, it's querying for "checkup". Could I please get assistance here debugging or any recommendations on making our query tool more robust? Thanks in advance! The tool call ID here:
call_4SttIYESZ9953W9Gk5oJq2uD
Call ID here:
019c454e-e963-7ccf-8388-e580a49705be
v
To debug a tool call via
toolCallId
, filter your call logs for entries containing the specific
toolCallId
(e.g.,
call_4SttIYESZ9953W9Gk5oJq2uD
). Look for error messages like "ok, no result returned" or "Schema validation errors" to pinpoint issues. For example:
Copy code
{
  "toolCallId": "call_4SttIYESZ9953W9Gk5oJq2uD",
  "result": "No answer found in the knowledge base"
}
This helps you trace the exact request/response cycle and identify if the toolCallId matches and if the response format is correct. For more, see the [Custom Tools Troubleshooting guide](https://docs.vapi.ai/tools/custom-tools-troubleshooting). Source: - [Custom Tools Troubleshooting guide](https://docs.vapi.ai/tools/custom-tools-troubleshooting)
j
Hey, good question, this usually happens when the KB search isn’t matching the phrasing exactly, so small changes like “checkup” vs “general check-up” can cause it to return nothing. I’d first check how that term is indexed and whether variations or synonyms are included. It also helps to log the full resolved query at runtime to see what the agent is really sending. Quick question: is “checkup” saved as its own entry, or only inside longer descriptions? @Jimmy
j
Hey @James Christopher Thank you for the reply - I've looked into this further and could try to enforce specific keyword look ups. Another related failure mode we are experiencing is the same query tool is actually returning extracts of the conversation history. @Vapi Are you able to look into this issue? Both failure modes occurred in this single call: 019c4a67-4def-700c-ad36-2643f6ff80a7
j
Hey, thanks for looking into this, what you’re seeing is pretty common when the tool query isn’t consistent and the system falls back to conversation context when it can’t find a solid KB match. Usually this can be fixed by tightening how the query is formed, adding proper keyword/synonym mapping, and validating the tool response before it’s used. I’ve helped a few teams clean this up and make their retrieval much more reliable. If you’d like, I’m happy to look at your setup and walk through this with you privately. @Jimmy
j
@James Christopher Sure, can you give me a ping let's chat
j
Sure sent please check
s
is it solved @Jimmy
c
Hey, I'm closing this ticket now. Let me know if you need anything else.