Skip to content

Vercel AI SDK returns empty text after MCP tool call resolution #6867

Open
@Vineetttt30

Description

@Vineetttt30

Description

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",
Successful tool calls 

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)

AI SDK Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai/corebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions