Vercel AI SDK returns empty text after MCP tool call resolution

When invoking a tool via experimental_createMCPClient() and generateText using the Vercel AI SDK, the final .text field in the response is always an empty string, even though the tool result contains valid data.

  • Issue replicates even with maxToolRoundtrips: 3 set.
"text": "",
  "files": [],
  "reasoningDetails": [],
  "toolCalls": [
    {
      "type": "tool-call",
      "toolCallId": "9COeKo3dUxyMgLea",
      "toolName": "get_l1_orderbook",
...

FYI Env

ai: 4.3.16

@ai-sdk/google: 1.2.19

bun: 1.2.16

Model: gemini-1.5-pro-latest

Tools: experimental_createMCPClient() (SSE-based)

Tool calls store their output in the tool result and won’t usually have a .text field, unless you’ve explicitly requested it like “get the weather for London and return a summary”

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.