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?