LegacyWebSearchServerTool - TypeScript SDK
LegacyWebSearchServerTool - TypeScript SDK
LegacyWebSearchServerTool type definition
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Web search tool configuration
LegacyWebSearchServerTool - TypeScript SDK
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Web search tool configuration
1 import { LegacyWebSearchServerTool } from "@openrouter/sdk/models"; 2 3 let value: LegacyWebSearchServerTool = { 4 type: "web_search", 5 };
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
engine | models.WebSearchEngineEnum | ➖ | Which search engine to use. “auto” (default) uses native if the provider supports it, otherwise Exa. “native” forces the provider’s built-in search. “exa” forces the Exa search API. “firecrawl” uses Firecrawl (requires BYOK). “parallel” uses the Parallel search API. | auto |
filters | models.WebSearchDomainFilter | ➖ | N/A | {"allowed_domains": ["example.com"],"excluded_domains": ["spam.com"]} |
maxResults | number | ➖ | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. | 5 |
searchContextSize | models.SearchContextSizeEnum | ➖ | Size of the search context for web search tools | medium |
type | ”web_search” | ✔️ | N/A | |
userLocation | models.WebSearchUserLocation | ➖ | User location information for web search | {"city": "San Francisco","country": "USA","region": "California","timezone": "America/Los_Angeles","type": "approximate"} |