From 9ffd70aae0574d898dc2ad0d5c460787a93863c7 Mon Sep 17 00:00:00 2001 From: kage18 <18kushaljain@gmail.com> Date: Fri, 15 May 2026 23:24:38 +0530 Subject: [PATCH] docs: mention tool name migration --- .../24-migration-guide-6-0.mdx | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/content/docs/08-migration-guides/24-migration-guide-6-0.mdx b/content/docs/08-migration-guides/24-migration-guide-6-0.mdx index 75b75fa79492..e6d9b46afa5a 100644 --- a/content/docs/08-migration-guides/24-migration-guide-6-0.mdx +++ b/content/docs/08-migration-guides/24-migration-guide-6-0.mdx @@ -301,6 +301,38 @@ const someTool = tool({ codebase. +### Tool `name` Property Removal + +The `name` property has been removed from `tool()`. In AI SDK 6, the tool name +comes from the key in the `tools` object. + +```tsx filename="AI SDK 5" +import { tool } from 'ai'; +import { z } from 'zod'; + +const weatherTool = tool({ + name: 'weather', + description: 'Get the weather', + inputSchema: z.object({ + city: z.string(), + }), +}); +``` + +```tsx filename="AI SDK 6" +import { tool } from 'ai'; +import { z } from 'zod'; + +const tools = { + weather: tool({ + description: 'Get the weather', + inputSchema: z.object({ + city: z.string(), + }), + }), +}; +``` + ### `cachedInputTokens` and `reasoningTokens` in `LanguageModelUsage` Deprecation `cachedInputTokens` and `reasoningTokens` in `LanguageModelUsage` have been deprecated.