get_web_search_summaries
Retrieve web search summaries to quickly explore available sources and identify relevant information for initial research or topic overview.
Instructions
Get lightweight web search results with only result summaries.
Use this when you need a quick overview of available sources without full content. This gets search result titles, URLs, and descriptions for quick research or when you only need an overview of available information.
Use this when you want to quickly understand what information is available on a topic before diving deeper with full content extraction.
Args: query: Search query string (1-200 characters) limit: Number of search result summaries to return (1-10, default 5) top_n: Alternative name for limit (for compatibility) recency_days: Days to look back for recent content (time filtering) source: Content type filter ("news", "images", "videos", etc.) language: Language filter (e.g., "en", "es", "fr", "de") country: Geographic filter (e.g., "US", "GB", "FR", "DE")
Returns: Formatted text containing search result summaries (title, URL, description)
Parameter Usage Guidelines
query (required)
Search query string (1-200 characters)
Use specific, descriptive search terms
limit (optional, default 5)
Range: 1-10 results
Usage Examples
Basic topic exploration:
Quick source discovery:
Recent news exploration:
Geographic research:
Content type discovery:
Complete parameter example:
When to Choose This Tool
Primary Decision Criteria:
Choose this for initial research phase: Understand what sources are available
Choose this for topic exploration: Get an overview before deep diving
Choose this for source identification: Find relevant URLs for later extraction
Choose this for quick fact-checking: Verify if information sources exist
Choose this for research planning: Identify the scope of available information
Decision Matrix: When to Use Each Tool
Use get_web_search_summaries when:
✅ You need to explore what's available on a topic
✅ You want to identify relevant sources quickly
✅ You're doing preliminary research
✅ You need to validate if sources exist
✅ You want to see search result diversity
✅ Speed is more important than content depth
Use full_web_search when:
✅ You need actual content from sources
✅ You're doing detailed research or analysis
✅ You need to cite or reference specific information
✅ You want to compare information across sources
✅ Content depth is more important than speed
Use get_single_web_page_content when:
✅ You have specific URLs to extract
✅ You found relevant URLs from summaries
✅ You need to extract from known sources
Workflow Patterns
Two-stage research:
Use
get_web_search_summariesto identify sourcesUse
get_single_web_page_contenton promising URLsOr use
full_web_searchwith focused query
Topic mapping:
Use
get_web_search_summarieswith broad termsAnalyze result diversity and topics
Use
full_web_searchfor detailed investigation
Source validation:
Use
get_web_search_summariesto check if sources existEvaluate source quality and relevance
Proceed with content extraction if validated
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| limit | No | ||
| top_n | No | ||
| recency_days | No | ||
| source | No | ||
| language | No | ||
| country | No |
Implementation Reference
- features/web_search/tool.py:99-154 (handler)The core handler function for the 'get_web_search_summaries' MCP tool. It handles parameter aliases (top_n=limit), prepares filters (recency_days, source, language, country), calls WebSearchService.search_summaries, formats results as numbered markdown list with title/URL/description, and returns MCP-standard content block.@mcp.tool() @inject_docstring(lambda: load_instruction("instructions_summaries.md", __file__)) async def get_web_search_summaries( query: str, limit: int = 5, top_n: int = None, # Alternative name for limit (for compatibility) recency_days: int = None, # Days to look back (now supported!) source: str = None, # Source type filter (partially supported) language: str = None, # Language filter (now supported!) country: str = None # Country filter (now supported!) ) -> Dict[str, Any]: """Lightweight web search returning only summaries""" try: # Handle alternative parameter names actual_limit = top_n if top_n is not None else limit # Prepare supported parameters search_params = {} if recency_days is not None: search_params['recency_days'] = recency_days logger.info(f"Using recency_days filter: {recency_days} days") if source is not None: search_params['source'] = source logger.info(f"Using source filter: '{source}'") if language is not None: search_params['language'] = language logger.info(f"Using language filter: '{language}'") if country is not None: search_params['country'] = country logger.info(f"Using country filter: '{country}'") logger.info(f"MCP tool get_web_search_summaries: query='{query}', limit={actual_limit}") result = await web_search_service.search_summaries( query=query, limit=min(actual_limit, 10), # Cap at 10 **search_params # Pass all supported parameters to service ) # Format for MCP response response_text = f"Search summaries for '{result['query']}' with {result['total_results']} results:\n\n" for i, summary in enumerate(result['results'], 1): response_text += f"**{i}. {summary['title']}**\n" response_text += f"URL: {summary['url']}\n" response_text += f"Description: {summary['description']}\n\n---\n\n" logger.info(f"MCP tool get_web_search_summaries completed: {result['total_results']} results") return { "content": [{"type": "text", "text": response_text}] } except Exception as e: logger.error(f"MCP tool get_web_search_summaries error: {e}") raise
- server.py:39-42 (registration)The point where the web_search tools, including 'get_web_search_summaries', are registered with the MCP server by calling register_tool(mcp, web_search_service). This occurs in the main MixSearchService class.def register_mcp_tools(self, mcp): """Register MCP tools""" register_tool(mcp, self.web_search_service)
- Key helper method WebSearchService.search_summaries that executes the actual search using _multi_engine_search (DDGS/Brave/DuckDuckGo fallback with filters), returns structured summary results without content extraction.async def search_summaries(self, query: str, limit: int = 5, **kwargs) -> Dict[str, Any]: """Lightweight search returning only summaries using multi-engine approach""" logger.info(f"Starting multi-engine search for summaries: '{query}' with parameters: {kwargs}") # Use multi-engine search instead of just Brave API results = await self._multi_engine_search(query, limit, **kwargs) # Format results as summaries (no content extraction needed) return { "query": query, "results": [ { "title": r.title, "url": r.url, "description": r.description, "timestamp": r.timestamp } for r in results ], "total_results": len(results), "status": "success" }
- features/web_search/models.py:42-48 (schema)Pydantic schema model SearchSummaryModel defining the structure of individual search summary results (title, url, description, timestamp) used by the service and matching the MCP tool output format.class SearchSummaryModel(BaseModel): """Search result summary (no content)""" title: str = Field(..., description="Page title") url: str = Field(..., description="Page URL") description: str = Field(..., description="Search result description") timestamp: Optional[str] = Field(None, description="Timestamp")
- Supporting helper _multi_engine_search that implements fallback logic across DDGS (preferred), Brave, and DuckDuckGo search engines, applying filters like recency_days, language, country, source, and quality assessment before returning SearchResult list.async def _multi_engine_search(self, query: str, limit: int, **kwargs) -> List[SearchResult]: """Try multiple search engines in order of preference""" engines = [ ("DDGS", self._search_ddgs), # DDGS with Brave/DDG backends (highest priority) ("Brave", self._search_brave), # Browser-based Brave (fallback) ("DuckDuckGo", self._search_duckduckgo) # Browser-based DDG (last resort) ] for engine_name, engine_func in engines: try: logger.info(f"Trying {engine_name} search engine") results = await engine_func(query, limit, **kwargs) if results and self._assess_result_quality(results, query) >= 0.3: logger.info(f"Using results from {engine_name}: {len(results)} results") return results[:limit] except Exception as e: logger.warning(f"Search engine {engine_name} failed: {e}") continue logger.warning("All search engines failed, returning empty results") return []