Most providers expose native tools beyond user-defined function calls: web search, code execution, computer use, hosted retrieval, and more. TanStack AI exports each provider's native tools from a dedicated /tools subpath per adapter package.
You have an adapter already wired up. You want to give the model access to a provider-native capability (e.g. Anthropic web search) and be sure you never pair a tool with a model that doesn't support it. By the end of this page, you'll have imported the factory, added it to chat({ tools: [...] }), and understood the compile-time guard that will catch unsupported combinations.
Every adapter ships provider tools on a /tools subpath:
import { webSearchTool } from '@tanstack/ai-anthropic/tools'
import { codeInterpreterTool } from '@tanstack/ai-openai/tools'
import { googleSearchTool } from '@tanstack/ai-gemini/tools'import { webSearchTool } from '@tanstack/ai-anthropic/tools'
import { codeInterpreterTool } from '@tanstack/ai-openai/tools'
import { googleSearchTool } from '@tanstack/ai-gemini/tools'import { chat } from '@tanstack/ai'
import { anthropicText } from '@tanstack/ai-anthropic'
import { webSearchTool } from '@tanstack/ai-anthropic/tools'
const stream = chat({
adapter: anthropicText('claude-opus-4-6'),
messages: [{ role: 'user', content: "Summarize today's AI news." }],
tools: [
webSearchTool({
name: 'web_search',
type: 'web_search_20250305',
max_uses: 3,
}),
],
})import { chat } from '@tanstack/ai'
import { anthropicText } from '@tanstack/ai-anthropic'
import { webSearchTool } from '@tanstack/ai-anthropic/tools'
const stream = chat({
adapter: anthropicText('claude-opus-4-6'),
messages: [{ role: 'user', content: "Summarize today's AI news." }],
tools: [
webSearchTool({
name: 'web_search',
type: 'web_search_20250305',
max_uses: 3,
}),
],
})Every provider-specific tool factory (e.g. webSearchTool, computerUseTool) returns a ProviderTool<TProvider, TKind> brand. The adapter's toolCapabilities (derived from each model's supports.tools list) gates which brands are assignable to tools.
Paste a computerUseTool(...) into a model that doesn't expose it, and TypeScript reports an error on that array element — not on the factory call, not at runtime. User-defined toolDefinition() tools stay unbranded and always assignable. The customTool factories exported from ai-anthropic and ai-openai also return a plain Tool (not a ProviderTool brand) and are therefore universally accepted by any chat model, just like toolDefinition().
| Provider | Tools |
|---|---|
| Anthropic | webSearchTool, webFetchTool, codeExecutionTool, computerUseTool, bashTool, textEditorTool, memoryTool — see Anthropic adapter. |
| OpenAI | webSearchTool, webSearchPreviewTool, fileSearchTool, imageGenerationTool, codeInterpreterTool, mcpTool, computerUseTool, localShellTool, shellTool, applyPatchTool — see OpenAI adapter. |
| Gemini | codeExecutionTool, fileSearchTool, googleSearchTool, googleSearchRetrievalTool, googleMapsTool, urlContextTool, computerUseTool — see Gemini adapter. |
| OpenRouter | webSearchTool — see OpenRouter adapter. |
| Grok | function tools only (no provider-specific tools). |
| Groq | function tools only (no provider-specific tools). |
Each adapter's supports.tools array is the source of truth. The comparison matrix is maintained alongside model-meta.ts and reflected here:
For the exact per-model list, open the adapter page or read the model's supports.tools array directly from model-meta.ts.
If you were using createWebSearchTool from @tanstack/ai-openrouter, see Migration Guide §6.