[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[AI SDK](/c/ai-sdk/62)

# Dynamic tool loading and mid-conversation refresh in the Vercel AI SDK

65 views · 1 like · 1 post


Daniel Kelleher (@dankelleher) · 2026-03-02 · ♥ 1

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 `generateText` and `streamText`

[https://www.npmjs.com/package/ai-sdk-tool-refresh](https://www.npmjs.com/package/ai-sdk-tool-refresh)