Documentation
¶
Overview ¶
Package websearchtool implements the WebSearch tool.
Unlike most tools that call external APIs directly, WebSearch delegates to Anthropic's native web_search_20250305 server-side tool. It makes a secondary streaming API call with only the native search tool declared, then assembles the results (text, citations, search hits) into a single text block returned to the main agent.
Mirrors src/tools/WebSearchTool/WebSearchTool.ts. max_uses=8 is hardcoded to match the TS implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct {
Query string `json:"query"`
AllowedDomains []string `json:"allowed_domains,omitempty"`
BlockedDomains []string `json:"blocked_domains,omitempty"`
}
Input is the typed view of the JSON input.
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool implements the WebSearch tool.
func (*Tool) Description ¶
func (*Tool) Execute ¶
Execute runs a web search via Anthropic's native search tool and returns a formatted text block with results and sources.
func (*Tool) InputSchema ¶
func (*Tool) InputSchema() json.RawMessage
func (*Tool) IsConcurrencySafe ¶
func (*Tool) IsConcurrencySafe(json.RawMessage) bool
func (*Tool) IsReadOnly ¶
func (*Tool) IsReadOnly(json.RawMessage) bool