vercel/ai · error
`functions` is not supported in `streamUI`, use `tools` inst
Error message
`functions` is not supported in `streamUI`, use `tools` instead.
What it means
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.
Source
Thrown at packages/rsc/src/stream-ui/stream-ui.tsx:185
/**
* Optional response data.
*/
response?: {
/**
* Response headers.
*/
headers?: Record<string, string>;
};
}) => Promise<void> | void;
}): Promise<RenderResult> {
// TODO: Remove these errors after the experimental phase.
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,
);
}
}
}View on GitHub (pinned to 69428b1f8b)
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
Example fix
// before
streamUI({ model, functions: { myTool } });
// after
streamUI({ model, tools: { myTool } }); Defensive patterns
Strategy: validation
Validate before calling
if ('functions' in settings) throw new TypeError('Use `tools` instead of `functions`'); Prevention
- 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
When it happens
Trigger: Calling streamUI({ ..., functions: {...} }) — the check `'functions' in settings` throws before any execution.
Common situations: 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.
Related errors
- `provider` is no longer needed in `streamUI`. Use `model` in
- `model` cannot be a string in `streamUI`. Use the actual mod
- Tool definition in `streamUI` should not have `render` prope
- 'element streams in no-schema mode' functionality not suppor
- 'element streams in object mode' functionality not supported
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/7bbbba30667de24e.
Report an issue: GitHub.