Missing toolCall property in Dialogflow Messenger response from Vertex AI Agent

I’m working with Function Tools in Vertex AI Agent Builder and running into an issue. The documentation shows that when an agent detects a tool should be called, it returns a toolCall object in the response:

{
  "result": {
    "userQuery": "check temperature in San Francisco",
    "language": "en",
    "messages": [
      {
        "origin": "BOT_AGENT",
        "functionCall": {
          "function": "<function-id>",
          "method": "fetch-temperature",
          "params": {
            "city": "San Francisco"
          }
        }
      }
    ]
  }
}

Testing in the Agent Builder interface works fine. When I ask about weather, the network call to dialogflow.clients6.google.com shows the toolCall data correctly:

"result": {
  "userQuery": "what's the temperature in Paris?",
  "language": "en", 
  "messages": [
    {
      "origin": "BOT_AGENT",
      "functionCall": {
        "function": "projects/myproject/locations/us/agents/12345/tools/67890",
        "method": "fetchTemperature", 
        "params": {
          "city": "Paris, France",
          "scale": "fahrenheit"
        }
      }
    }
  ]
}

However, when using Dialogflow Messenger integration, the API calls dialogflow.googleapis.com/v3/ and returns empty response messages without the toolCall:

"result": {
  "userQuery": "what's the temperature in Paris?", 
  "language": "en",
  "messages": [
    {}
  ]
}

This causes subsequent requests to fail with “Session is waiting for tool call result” errors. Why does the playbook interface work differently than Dialogflow Messenger? How can I get the toolCall data in the messenger response?

This behavior occurs because Dialogflow Messenger manages function calls internally and does not expose them to the client. While the Agent Builder presents raw API responses for debugging purposes, the messenger widget conceals the toolCall mechanics. I encountered similar issues when transitioning from the testing console to production. The messenger is designed to expect your webhook to handle complete function execution automatically. Ensure your webhook receives the function call, processes it, and returns results back to Dialogflow within the same request cycle. It’s crucial to check your agent’s webhook configuration in the console; it should process tool calls synchronously and provide the final response rather than just the toolCall object. For access to the raw toolCall data, consider implementing a custom integration using the Dialogflow API instead of relying on the pre-built messenger widget.

Been dealing with this exact frustration for months. The problem is Dialogflow Messenger expects your tools to be fully automated webhooks, not interactive function calls.

When you test in Agent Builder, you’re seeing the raw detection output. But Messenger assumes your webhook will catch that toolCall, execute it, and feed results back automatically. No human involvement.

Here’s what worked for me: Set up your webhook to intercept those function calls before they hit the frontend. Your endpoint needs to:

  1. Detect the toolCall in the request
  2. Execute the actual function (like fetching weather data)
  3. Return the final answer to Dialogflow in the same response

The empty messages array you’re seeing means Dialogflow is waiting for your webhook to complete the cycle. It won’t pass toolCall data to the client because it expects everything to happen server side.

If you need client side control over function execution, skip Messenger entirely. Use the REST API directly with detectIntent calls. Way more control but obviously more work to build the UI.