google_search_lens
Search Google by submitting a URL to retrieve relevant results. Specify country and language to refine the search scope.
Instructions
Search Google for results
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The url to search | |
| gl | No | The country to search in, e.g. us, uk, ca, au, etc. | |
| hl | No | The language to search in, e.g. en, es, fr, de, etc. |
Implementation Reference
- src/serper_mcp_server/core.py:14-17 (handler)The handler function that executes google_search_lens logic. It derives the API endpoint by taking the last segment of the tool name (e.g., 'lens' from 'google_search_lens') and makes a POST request to the Serper.dev API.
async def google(tool: SerperTools, request: BaseModel) -> Dict[str, Any]: uri_path = tool.value.split("_")[-1] url = f"https://google.serper.dev/{uri_path}" return await fetch_json(url, request) - The LensRequest input schema for the google_search_lens tool. It accepts a 'url' (required), and optional 'gl' (country) and 'hl' (language) fields.
class LensRequest(BaseModel): url: str = Field(..., description="The url to search") gl: Optional[str] = Field( None, description="The country to search in, e.g. us, uk, ca, au, etc." ) hl: Optional[str] = Field( None, description="The language to search in, e.g. en, es, fr, de, etc." ) - src/serper_mcp_server/server.py:34-34 (registration)Maps the SerperTools.GOOGLE_SEARCH_LENS enum value to the LensRequest schema in the google_request_map, which is used for tool registration and execution routing.
SerperTools.GOOGLE_SEARCH_LENS: LensRequest, - src/serper_mcp_server/server.py:41-60 (registration)The list_tools() function that registers the tool with MCP by iterating the request map and creating Tool objects with the name (google_search_lens) and input schema.
@server.list_tools() async def list_tools() -> List[Tool]: tools = [] for k, v in google_request_map.items(): tools.append( Tool( name=k.value, description="Search Google for results", inputSchema=v.model_json_schema(), ), ) tools.append(Tool( name=SerperTools.WEBPAGE_SCRAPE, description="Scrape webpage by url", inputSchema=WebpageRequest.model_json_schema(), )) return tools - src/serper_mcp_server/enums.py:13-13 (helper)The enum definition GOOGLE_SEARCH_LENS = 'google_search_lens', which is the canonical string identifier for the tool.
GOOGLE_SEARCH_LENS = "google_search_lens"