The Vercel AI SDK locks your tool set when generateText or streamText starts. If a tool call loads new capabilities (such as MCP servers, skills, or agent handoffs), they aren’t available until you restart the generation.
While this is useful in most cases (and allows things like type-safety with tool responses), there are times when this is less convenient—for example, when new tools are exposed after a login tool completes.
Solution: ai-sdk-tool-refresh
While it would be nice if the SDK supported this directly, I’ve created a small plugin that makes this easy: ai-sdk-tool-refresh.
- Zero dependencies
- Works with both
generateTextandstreamText