# web_search

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/tools/web_search)

Search the web using Tavily for current information and documentation.

This tool searches the web and returns relevant results. After receiving results,
you MUST synthesize the information into a natural, helpful response for the user.

## Signature

```python
web_search(
    query: str,
    max_results: int = 5,
    topic: Literal['general', 'news', 'finance'] = 'general',
    include_raw_content: bool = False,
)
```

## Description

IMPORTANT: After using this tool:
1. Read through the 'content' field of each result
2. Extract relevant information that answers the user's question
3. Synthesize this into a clear, natural language response
4. Cite sources by mentioning the page titles or URLs
5. NEVER show the raw JSON to the user - always provide a formatted response

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `query` | `str` | Yes | The search query (be specific and detailed) |
| `max_results` | `int` | No | Number of results to return (default: 5) (default: `5`) |
| `topic` | `Literal['general', 'news', 'finance']` | No | Search topic type - "general" for most queries, "news" for current events (default: `'general'`) |
| `include_raw_content` | `bool` | No | Include full page content (warning: uses more tokens) (default: `False`) |

## Returns

`null`

Dictionary containing:

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/1ae053f347679e58562d2b81eb6d6e6e9bbf0b07/libs/cli/deepagents_cli/tools.py#L35)