URGENT: Query tool is not working
# support
n
Query tool calls ignore required query param + assistant overrides confusing tool schema Hi Vapi Support , we’re troubleshooting a query tool used for searching listings and the agent is being inconsistent in finding any listings, we had this agent setup for over 7+ month now and didn't make any changes related to these, it just started happening. Call ID: 019e51be-235d-7cc0-8ded-73523a374df4 and second one 019e51c5-27cd-7999-b546-2237c6e3772a
c
Hi, thanks for sharing the call IDs, I investigated both calls and found the root cause. The issue is that your
Astra_leasing_prototype
query tool schema only defines
knowledgeBaseNames
and does not explicitly define a required
query
parameter. Because of that, the assistant sometimes sends tool calls without the actual search text, which causes the knowledge base search to return
"No answer found in the knowledge base"
. Example of the tool call currently being sent:
Copy code
{
  "name": "Astra_leasing_prototype",
  "arguments": {
    "knowledgeBaseNames": [
      "Astra_listings_update"
    ]
  }
}
Since no query string is included, the KB has nothing to search against. To fix this, please update the tool parameter schema and add
query
as a required string field:
Copy code
{
  "type": "object",
  "properties": {
    "knowledgeBaseNames": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "Astra_listings_update",
          "Astra_Genenral_KB"
        ]
      },
      "minItems": 1
    },
    "query": {
      "type": "string",
      "description": "The search query in plain english, e.g. 'one bedroom apartment in Racine under $1200'"
    }
  },
  "required": [
    "knowledgeBaseNames",
    "query"
  ]
}
Also: • Verify the
Astra_listings_update
knowledge base still contains valid/up-to-date indexed content • Add explicit prompt instructions telling the assistant it must always include the
query
argument when calling the tool After updating, test another call and verify in the dashboard → Calls → Tool Calls that both: •
knowledgeBaseNames
query
are present in the tool arguments.