Customize Google Search Result Count
mainYou can modify the number of results returned by the search engine by editing the tool source files within your environment's site-packages.
For Serper
Locate serper_dev_tool.py inside site-packages/crewai_tools/tools/serper_dev_tool/ and update the n_results attribute (range: 10 to 100).
For SerpApi
Locate serpapi_google_search_tool.py inside site-packages/crewai_tools/tools/serpapi_tool/. By default, it only forwards q and location. You must manually add a "num" key to the client.search({...}) dictionary within the _run() method to control the result count.
# Serper example (in serper_dev_tool.py)
n_results: int = 10 # min: 10, max: 100
# SerpApi example (in serpapi_google_search_tool.py)
# Add 'num' to the search dict in _run()
results = self.client.search({
"q": kwargs.get("search_query"),
"num": 50
}).as_dict()