Anthropic's native Web Search Tool (web_search_20260209) gives Claude the ability to search the internet during a conversation. Unlike MCP-based search integrations, this is a first-party, built-in tool that Claude can invoke autonomously when it determines real-time information is needed.
// Enabling web search
const response = await anthropic.messages.create({
model: "claude-sonnet-4-6",
max_tokens: 4096,
tools: [{
type: "web_search_20260209",
name: "web_search",
max_uses: 5, // Limit searches per request
allowed_domains: ["docs.anthropic.com", "github.com"],
blocked_domains: ["reddit.com"]
}],
messages: [{ role: "user", content: "What are the latest MCP spec changes?" }]
});
For enterprise applications, you can restrict where Claude searches using allowed_domains (whitelist) and blocked_domains (blacklist). This ensures responses are grounded in trusted, approved sources only.
max_uses to control costs in production.