google_search_videos
Search Google for video content by entering queries, specifying location, language, and result count to find relevant video information.
Instructions
Search Google for results
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | The query to search for | |
| gl | No | The country to search in, e.g. us, uk, ca, au, etc. | |
| location | No | The location to search in, e.g. San Francisco, CA, USA | |
| hl | No | The language to search in, e.g. en, es, fr, de, etc. | |
| page | No | The page number to return, first page is 1 (integer value as string) | 1 |
| tbs | No | The time period to search in, e.g. d, w, m, y | |
| num | No | The number of results to return, max is 100 (integer value as string) | 10 |
Implementation Reference
- src/serper_mcp_server/core.py:14-40 (handler)Core handler logic for google_search_videos: constructs URL https://google.serper.dev/videos based on tool name and performs API request to Serper service via fetch_json.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) async def scape(request: WebpageRequest) -> Dict[str, Any]: url = "https://scrape.serper.dev" return await fetch_json(url, request) async def fetch_json(url: str, request: BaseModel) -> Dict[str, Any]: payload = request.model_dump(exclude_none=True) headers = { 'X-API-KEY': SERPER_API_KEY, 'Content-Type': 'application/json' } ssl_context = ssl.create_default_context(cafile=certifi.where()) connector = aiohttp.TCPConnector(ssl=ssl_context) timeout = aiohttp.ClientTimeout(total=AIOHTTP_TIMEOUT) async with aiohttp.ClientSession(connector=connector, timeout=timeout) as session: async with session.post(url, headers=headers, json=payload) as response: response.raise_for_status() return await response.json()
- Pydantic schema SearchRequest defining input parameters for google_search_videos tool (inherits from BaseRequest). Used for validation in tool registration.class SearchRequest(BaseRequest): tbs: Optional[str] = Field( None, description="The time period to search in, e.g. d, w, m, y" ) num: str = Field( "10", pattern=r"^([1-9]|[1-9]\d|100)$", description="The number of results to return, max is 100 (integer value as string)", )
- src/serper_mcp_server/server.py:25-38 (registration)Registration mapping that associates SerperTools.GOOGLE_SEARCH_VIDEOS with SearchRequest schema, used by list_tools() and call_tool().google_request_map = { SerperTools.GOOGLE_SEARCH: SearchRequest, SerperTools.GOOGLE_SEARCH_IMAGES: SearchRequest, SerperTools.GOOGLE_SEARCH_VIDEOS: SearchRequest, SerperTools.GOOGLE_SEARCH_PLACES: AutocorrectRequest, SerperTools.GOOGLE_SEARCH_MAPS: MapsRequest, SerperTools.GOOGLE_SEARCH_REVIEWS: ReviewsRequest, SerperTools.GOOGLE_SEARCH_NEWS: SearchRequest, SerperTools.GOOGLE_SEARCH_SHOPPING: ShoppingRequest, SerperTools.GOOGLE_SEARCH_LENS: LensRequest, SerperTools.GOOGLE_SEARCH_SCHOLAR: AutocorrectRequest, SerperTools.GOOGLE_SEARCH_PATENTS: PatentsRequest, SerperTools.GOOGLE_SEARCH_AUTOCOMPLETE: AutocorrectRequest, }
- src/serper_mcp_server/server.py:76-79 (registration)Dispatch logic in call_tool() that uses the mapping to instantiate request schema and call the google handler for the tool.tool = SerperTools(name) request = google_request_map[tool](**arguments) result = await google(tool, request) return [TextContent(text=json.dumps(result, indent=2), type="text")]
- src/serper_mcp_server/enums.py:7-7 (helper)Enum definition providing the exact tool name string 'google_search_videos' used throughout the codebase.GOOGLE_SEARCH_VIDEOS = "google_search_videos"