# create_web_search_tool

> **Function** in `deepagents_code`

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

Bind web search to one workspace credential.

The schema is taken from `web_search` via `functools.wraps` so the built-in
and workspace-bound variants can never present different arguments. The two
also have to fail the same way: `is_web_search_tool` treats them as one, so
a missing package or an unusable key must return the payload the model can
act on rather than raising.

## Signature

```python
create_web_search_tool(
    api_key: str,
) -> BaseTool
```

## Returns

`BaseTool`

Workspace-bound web search tool.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/caaa7e7c12d214afa5cf0a1afed8eb6232aa6f7b/libs/code/deepagents_code/tools.py#L348)