vercel · Vercel AI SDK Docs
AI SDK Foundations: Tools
Explains how to define and implement tool calling within the AI SDK, allowing models to interact with external functions and structured data.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
AI SDK Foundations: Tools
Explains how to define and implement tool calling within the AI SDK, allowing models to interact with external functions and structured data.
When To Use
Use when you need to enable an LLM to execute specific functions, call external APIs, or interact with your application's internal logic during a conversation.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/ai-sdk-foundations-tools-workflow-guide.md | A guide explaining the concept, types, and implementation of custom and provider-defined tools within the Vercel AI SDK. | Questions about a guide explaining the concept, types, and implementation of custom and provider-defined tools within the Vercel AI SDK. |
examples/ai-sdk-foundations-tools-ai-sdk-tools-definition-typescript.text | A TypeScript code example demonstrating how to define a tool using the AI SDK tool function and Zod schema. | Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to define a tool using the AI SDK tool function and Zod schema. |
examples/ai-sdk-foundations-tools-ai-sdk-tools-generatetext-anthropic.text | A TypeScript code example demonstrating how to use the AI SDK generateText function with Anthropic model tool calling. | Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to use the AI SDK generateText function with Anthropic model tool calling. |
examples/ai-sdk-foundations-tools-ai-sdk-tools-generate.text | A TypeScript code example demonstrating how to use the generateText function with tool definitions in the AI SDK. | Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to use the generateText function with tool definitions in the AI SDK. |
examples/ai-sdk-foundations-tools-installation-command.text | The shell command required to install a tool package using pnpm for the AI SDK. | Exact payloads, commands, or snippets shown in The shell command required to install a tool package using pnpm for the AI SDK. |
examples/ai-sdk-foundations-tools-ai-sdk-tools-generate-2.text | A TypeScript code example demonstrating how to use the generateText function with a tools object to enable model tool calling. | Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to use the generateText function with a tools object to enable model tool... |
examples/ai-sdk-foundations-tools-ai-sdk-tools-typescript-definition.text | A TypeScript code example demonstrating how to define a tool using the tool function and zod schema from the AI SDK. | Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to define a tool using the tool function and zod schema from the AI SDK. |
What This Skill Covers
- While large language models (LLMs) have incredible generation capabilities, they struggle with discrete tasks (e.g. mathematics) and interacting with the out...
- Main sections:
What is a tool?,Types of Tools,Custom Tools,Provider-Defined Tools,Provider-Executed Tools.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://ai-sdk.dev/docs/foundations/tools