{"record":{"id":"2e23bd2085fab287","repo":"vercel/ai","slug":"tool-definition-in-streamui-should-not-have-ren","errorCode":null,"errorMessage":"Tool definition in `streamUI` should not have `render` property. Use `generate` instead. Found in tool: ${name}","messagePattern":"Tool definition in `streamUI` should not have `render` property\\. Use `generate` instead\\. Found in tool: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/rsc/src/stream-ui/stream-ui.tsx","lineNumber":197,"sourceCode":"  if (typeof model === 'string') {\n    throw new Error(\n      '`model` cannot be a string in `streamUI`. Use the actual model instance instead.',\n    );\n  }\n  if ('functions' in settings) {\n    throw new Error(\n      '`functions` is not supported in `streamUI`, use `tools` instead.',\n    );\n  }\n  if ('provider' in settings) {\n    throw new Error(\n      '`provider` is no longer needed in `streamUI`. Use `model` instead.',\n    );\n  }\n  if (tools) {\n    for (const [name, tool] of Object.entries(tools)) {\n      if ('render' in tool) {\n        throw new Error(\n          'Tool definition in `streamUI` should not have `render` property. Use `generate` instead. Found in tool: ' +\n            name,\n        );\n      }\n    }\n  }\n\n  const ui = createStreamableUI(initial);\n\n  // The default text renderer just returns the content as string.\n  const textRender = text || defaultTextRenderer;\n\n  let finished: Promise<void> | undefined;\n\n  let finishEvent: {\n    finishReason: FinishReason;\n    usage: LanguageModelV4Usage;\n    warnings?: CallWarning[];","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/rsc/src/stream-ui/stream-ui.tsx#L179-L215","documentation":"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.","triggerScenarios":"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`.","commonSituations":"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.","solutions":["Rename `render` to `generate` in the tool definition for server-executed tools","If the tool should render UI, move that tool definition to the client side or follow the current streamUI tools schema","Loop through your tools object and remove/replace any entry containing `render`"],"exampleFix":"// before\nconst tools = { weather: { render: async (args) => <Weather args={args} /> } };\n// after\nconst tools = { weather: { generate: async (args) => data } };","handlingStrategy":"validation","validationCode":"for (const [name, tool] of Object.entries(tools)) {\n  if ('render' in tool) throw new TypeError(`Tool ${name} must use 'generate', not 'render'`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep server tools (generate) and client UI tools separate","Type tools with the streamUI Tools type","Review tool definitions after copying from client-side examples"],"tags":["api-misuse","migration","tools"],"backgroundTag":"invalid-tool-definition","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}