vercel/ai · error

Tool definition in `streamUI` should not have `render` prope

Error message

Tool definition in `streamUI` should not have `render` property. Use `generate` instead. Found in tool: ${name}

What it means

In streamUI, server-side tool definitions must use `generate` for non-UI tools; a tool carrying a `render` property is a UI-rendering mistake and is rejected. The error names the offending tool to make it easy to locate.

Source

Thrown at packages/rsc/src/stream-ui/stream-ui.tsx:197

  if (typeof model === 'string') {
    throw new Error(
      '`model` cannot be a string in `streamUI`. Use the actual model instance instead.',
    );
  }
  if ('functions' in settings) {
    throw new Error(
      '`functions` is not supported in `streamUI`, use `tools` instead.',
    );
  }
  if ('provider' in settings) {
    throw new Error(
      '`provider` is no longer needed in `streamUI`. Use `model` instead.',
    );
  }
  if (tools) {
    for (const [name, tool] of Object.entries(tools)) {
      if ('render' in tool) {
        throw new Error(
          'Tool definition in `streamUI` should not have `render` property. Use `generate` instead. Found in tool: ' +
            name,
        );
      }
    }
  }

  const ui = createStreamableUI(initial);

  // The default text renderer just returns the content as string.
  const textRender = text || defaultTextRenderer;

  let finished: Promise<void> | undefined;

  let finishEvent: {
    finishReason: FinishReason;
    usage: LanguageModelV4Usage;
    warnings?: CallWarning[];

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Rename `render` to `generate` in the tool definition for server-executed tools
  2. If the tool should render UI, move that tool definition to the client side or follow the current streamUI tools schema
  3. Loop through your tools object and remove/replace any entry containing `render`

Example fix

// before
const tools = { weather: { render: async (args) => <Weather args={args} /> } };
// after
const tools = { weather: { generate: async (args) => data } };
Defensive patterns

Strategy: validation

Validate before calling

for (const [name, tool] of Object.entries(tools)) {
  if ('render' in tool) throw new TypeError(`Tool ${name} must use 'generate', not 'render'`);
}

Prevention

When it happens

Trigger: Passing a tools object where any entry has a `render` key, e.g. reusing tool definitions from a client component or from an older API shape that used `render`.

Common situations: Copying tool definitions from useChat/useCompletion client examples that use `render`; reusing tools shared between server and client; migrating from an earlier API where render was the property name.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/2e23bd2085fab287. Report an issue: GitHub.