{"record":{"id":"7bbbba30667de24e","repo":"vercel/ai","slug":"functions-is-not-supported-in-streamui-use-t","errorCode":null,"errorMessage":"`functions` is not supported in `streamUI`, use `tools` instead.","messagePattern":"`functions` is not supported in `streamUI`, use `tools` instead\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/rsc/src/stream-ui/stream-ui.tsx","lineNumber":185,"sourceCode":"      /**\n       * Optional response data.\n       */\n      response?: {\n        /**\n         * Response headers.\n         */\n        headers?: Record<string, string>;\n      };\n    }) => Promise<void> | void;\n  }): Promise<RenderResult> {\n  // TODO: Remove these errors after the experimental phase.\n  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  }","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/rsc/src/stream-ui/stream-ui.tsx#L167-L203","documentation":"The RSC streamUI API renamed `functions` to `tools`. During the experimental phase it detects a `functions` key in the settings object and throws to force the migration. The behavior is now expressed via the `tools` option.","triggerScenarios":"Calling streamUI({ ..., functions: {...} }) — the check `'functions' in settings` throws before any execution.","commonSituations":"Code written against very early experimental versions of `ai/rsc`; copy-pasted snippets from old blog posts or docs; partial migration where model was updated to an instance but the old `functions` option was left.","solutions":["Rename the `functions` option to `tools`","Update tool definitions to the tools shape (schema/execute/render style used by streamUI)","Check the current ai/rsc documentation for the tools API"],"exampleFix":"// before\nstreamUI({ model, functions: { myTool } });\n// after\nstreamUI({ model, tools: { myTool } });","handlingStrategy":"validation","validationCode":"if ('functions' in settings) throw new TypeError('Use `tools` instead of `functions`');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Search the codebase for 'functions:' when migrating to streamUI","Follow current ai/rsc docs for the tools option shape","Enable TS excess property checks with a typed options object"],"tags":["api-misuse","migration","renamed-api"],"backgroundTag":"renamed-api-option","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}