# WebSearchTools and DuckDuckGoTools return rate-limit errors to the model

> Agno WebSearchTools and DuckDuckGoTools hand the model a readable error when DuckDuckGo rate-limits a search, and max_results and modifier now work in every search.

- Published: 2026-11-17
- Author: Anderson Gomes de Oliveira
- Categories: Changelog
- Canonical: https://www.agno.com/blog/websearchtools-and-duckduckgotools-return-rate-limit-errors-to-the-model
- Markdown: https://www.agno.com/blog/websearchtools-and-duckduckgotools-return-rate-limit-errors-to-the-model.md

Agno `WebSearchTools` and `DuckDuckGoTools` now hand the model a JSON error when DuckDuckGo rate-limits a search, so the agent can read what went wrong and decide what to do next. Before, both tools raised the ddgs exception straight out of `web_search` and `search_news`.

Two settings also behave as written now.

- `max_results=0` and `fixed_max_results=0` return an empty list without calling ddgs.
- `search_news` puts the `modifier` in front of the query, the same way `web_search` does.

```python
from agno.tools.duckduckgo import DuckDuckGoTools

news = DuckDuckGoTools(modifier="site:arxiv.org", fixed_max_results=3)
```

We replaced the `DDGS` client inside `agno.tools.websearch` with a stand-in that records each call, and made it raise the ddgs `RatelimitException` for the error case.

```text
# Before
web_search("agent memory") -> raised RatelimitException: https://duckduckgo.com 202 Ratelimit
# Now
web_search("agent memory") -> {"error": "RatelimitException", "message": "https://duckduckgo.com 202 Ratelimit", "query": "agent memory", "results": []}
```

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/91_tools/duckduckgo_tools.py), and learn more about [WebSearchTools](https://docs.agno.com/tools/toolkits/search/websearch) and [DuckDuckGoTools](https://docs.agno.com/tools/toolkits/search/duckduckgo) in the documentation.
