Function tools not providing toolCall response in Dialogflow integration

I’m working with Function Tools in Vertex AI Agent Builder and running into an issue. The documentation shows that when an agent decides to call a tool, the response should include a toolCall object.

Here’s what the expected response format looks like:

{
  "queryResult": {
    "text": "check temperature in San Francisco",
    "languageCode": "en",
    "responseMessages": [
      {
        "source": "VIRTUAL_AGENT",
        "toolCall": {
          "tool": "<tool-identifier>",
          "action": "fetch-temperature",
          "inputParameters": {
            "city": "San Francisco"
          }
        }
      }
    ]
  }
}

When I test in the Agent Builder interface by asking “what’s the temperature today”, I can see the network call to dialogflow.clients6.google.com/v3alpha1/ includes the toolCall data:

"queryResult": {
  "text": "what's the temperature in Berlin?",
  "languageCode": "en",
  "responseMessages": [
    {
      "source": "VIRTUAL_AGENT",
      "toolCall": {
        "tool": "projects/myproject/locations/us/agents/abc123/tools/def456",
        "action": "fetchTemperature",
        "inputParameters": {
          "city": "Berlin, Germany",
          "scale": "fahrenheit"
        }
      }
    }
  ]
}

However, when using Dialogflow Messenger integration, the API calls go to dialogflow.googleapis.com/v3/ and the toolCall is missing:

"queryResult": {
  "text": "what's the temperature in Berlin?",
  "languageCode": "en",
  "responseMessages": [
    {}
  ]
}

This causes problems because subsequent requests fail with an error about the session waiting for tool execution results. The same agent behaves differently between the builder interface and messenger integration. Why is there this inconsistency and how can I get toolCall data through the messenger integration?

I hit this same problem a few months ago. Dialogflow Messenger doesn’t handle toolCall responses like the Agent Builder interface does - you’ve got to build custom handling yourself. When the session waits for tool results, catch that state change and execute the tool manually. Then send results back with the sessions.fulfillIntent method. The messenger basically hands off tool calls to your app instead of running them directly. Double-check your webhook endpoint is set up to receive and process these tool requests - that’s usually where things break.

yeah, looks like you’ve got mismatched api versions. messenger’s probably on stable v3 while ur builder’s using v3alpha1. try switching messenger to the alpha endpoint or hunt for a flag that enables tool responses in v3.