> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter-d02e98a0-mintlify-7021d5f4.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# LegacyWebSearchServerTool - Python SDK

> LegacyWebSearchServerTool method reference

<Warning>
  The Python SDK and docs are currently in beta.
  Report issues on [GitHub](https://github.com/OpenRouterTeam/python-sdk/issues).
</Warning>

Web search tool configuration

## Fields

| Field                 | Type                                                                                                                   | Required             | Description                                                                                                                                                                                                                                                                | Example                                                                                                                     |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `engine`              | [Optional\[components.WebSearchEngineEnum\]](../components/websearchengineenum.md)                                     | :heavy\_minus\_sign: | 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`             | [OptionalNullable\[components.WebSearchDomainFilter\]](../components/websearchdomainfilter.md)                         | :heavy\_minus\_sign: | N/A                                                                                                                                                                                                                                                                        | `{"allowed_domains": ["example.com"],"excluded_domains": ["spam.com"]}`                                                     |
| `max_results`         | *Optional\[int]*                                                                                                       | :heavy\_minus\_sign: | 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                                                                                                                           |
| `search_context_size` | [Optional\[components.SearchContextSizeEnum\]](../components/searchcontextsizeenum.md)                                 | :heavy\_minus\_sign: | Size of the search context for web search tools                                                                                                                                                                                                                            | medium                                                                                                                      |
| `type`                | [components.LegacyWebSearchServerToolType](/client-sdks/python/api-reference/components/legacywebsearchservertooltype) | :heavy\_check\_mark: | N/A                                                                                                                                                                                                                                                                        |                                                                                                                             |
| `user_location`       | [OptionalNullable\[components.WebSearchUserLocation\]](../components/websearchuserlocation.md)                         | :heavy\_minus\_sign: | User location information for web search                                                                                                                                                                                                                                   | `{"city": "San Francisco","country": "USA","region": "California","timezone": "America/Los_Angeles","type": "approximate"}` |
