Function Tools not triggering toolCall response in Dialogflow Messenger integration

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 function call, it should return a toolCall object in the response.

{
  "result": {
    "userQuery": "what's the temperature in San Francisco",
    "language": "en",
    "messages": [
      {
        "origin": "BOT_AGENT",
        "functionCall": {
          "service": "<service-resource-id>",
          "method": "fetch-temperature-data",
          "parameters": {
            "city": "San Francisco"
          }
        }
      }
    ]
  }
}

Testing in the Agent Builder console works fine. When I ask “what’s the temperature”, the network call to dialogflow.clients6.google.com shows the toolCall properly:

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

However, when using Dialogflow Messenger integration (which calls dialogflow.googleapis.com/v3/), the toolCall is missing:

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

This causes subsequent requests to fail with “Session is waiting for tool call result of tool and action, fetchTemperature”. Why do the Agent Builder console and Dialogflow Messenger behave differently? How can I get the toolCall response in the messenger integration?

This happens because the API versions work differently between environments. Agent Builder’s console uses internal APIs that handle function tools natively, but Dialogflow Messenger through the v3 API processes them differently. You need to set up your integration to handle the function call workflow properly. That empty message means the system’s waiting for you to send back the tool execution result. Here’s what you should do: implement a client-side handler that detects function calls, runs the function, then sends the result back via the conversation API. Make sure your Dialogflow Messenger config handles function responses correctly, and double-check that your agent’s tool setup matches exactly in both environments. Without this round-trip setup, your session will just hang waiting for the tool result.

I encountered the same problem recently. The discrepancy arises because the Agent Builder console utilizes a newer beta API that appropriately manages toolCall responses, while Dialogflow Messenger relies on the older v3 API that does not support function calls in the same way. A solution that worked for me was to implement a webhook fulfillment that intercepts the function call prior to it reaching the Messenger. You’ll need to create a webhook endpoint that captures the toolCall data, processes the function, and formats the response accordingly. Additionally, check your webhook settings in the Fulfillment section to ensure that function calls are properly handled. It’s also important to confirm that you’re using the latest Messenger SDK, as older versions may not properly support the toolCall structure.

The empty messages happen because v3 API expects you to handle function execution externally and send results back. The other answers are right about API differences, but there’s a cleaner way.

Skip building custom webhook handlers or client-side processors - just automate the whole flow. Set up automation between your Dialogflow agent and function execution.

I’ve hit this same wall before. What works is an automated workflow that monitors function calls, executes them against your services, and feeds results back to Dialogflow seamlessly.

The workflow catches toolCall requests from Dialogflow, maps parameters to your APIs (weather, databases, whatever), grabs the data, and formats it back exactly how Dialogflow wants it. Users never see empty message states.

You can build this automation bridge pretty fast without tons of custom code. Check out https://latenode.com for this kind of API orchestration.