Interface: XAIWebSearchTool
@providerprotocol/ai / xai / XAIWebSearchTool
Interface: XAIWebSearchTool
Section titled “Interface: XAIWebSearchTool”Defined in: src/providers/xai/types.ts:284
Web search tool for real-time web information retrieval.
Enables Grok to search the web for up-to-date information. Pricing: $5 per 1,000 successful tool invocations.
Example
Section titled “Example”const tool: XAIWebSearchTool = { type: 'web_search', allowed_domains: ['wikipedia.org', 'github.com'],};Properties
Section titled “Properties”allowed_domains?
Section titled “allowed_domains?”
optionalallowed_domains:string[]
Defined in: src/providers/xai/types.ts:288
Restrict to specific domains (max 5, mutually exclusive with excluded_domains)
enable_image_understanding?
Section titled “enable_image_understanding?”
optionalenable_image_understanding:boolean
Defined in: src/providers/xai/types.ts:292
Enable image analysis from search results
excluded_domains?
Section titled “excluded_domains?”
optionalexcluded_domains:string[]
Defined in: src/providers/xai/types.ts:290
Exclude specific domains (max 5, mutually exclusive with allowed_domains)
type:
"web_search"
Defined in: src/providers/xai/types.ts:286
Tool type identifier