full_web_search
Perform comprehensive web searches with full page content extraction for detailed research and analysis across multiple sources.
Instructions
Get comprehensive web search results with full page content extraction.
Use this when you need detailed content from web sources for comprehensive research and analysis. This searches the web and extracts the full content from each result page.
Use this for comprehensive research or detailed information from web sources.
Args: query: Search query string (1-200 characters) limit: Number of results to return with full content (1-10, default 5) include_content: Whether to extract full page content (default true) max_content_length: Maximum characters per result content (0 = no limit) 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 results with full extracted content
Parameter Usage Guidelines
query (required)
Search query string (1-200 characters)
Use specific, descriptive search terms
limit (optional, default 5)
Range: 1-10 results
Higher limits take longer due to content extraction
include_content (optional, default true)
Set to
truefor full content extraction (default)Set to
falseto get only titles, URLs, and descriptions
max_content_length (optional, default unlimited)
Limits characters per result to manage response size
Common values:
10000(focused content),50000(detailed research),null(no limit)
top_n (optional, compatibility parameter)
Alternative name for
limitparameterRange: 1-10 results
recency_days (optional, time filtering)
Filters results to recent content only
Common values:
1(past day),7(past week),30(past month),365(past year)Use
-1ornullfor no time filter
source (optional, content type filtering)
Filters by content type
Supported values:
"news": News articles and current events"images": Image search results"videos": Video content"web"or null: Regular web search (default)
language (optional, language filtering)
Filters results by language
Supported values: Language codes like
"en","es","fr","de","zh"
country (optional, geographic filtering)
Filters results by geographic region/country
Supported values: Country codes like
"US","GB","FR","DE","CA"
Usage Examples
Basic search with default settings:
Quick overview (smaller limit):
Recent news search with time filtering:
Geographic and language filtering:
Comprehensive research with all parameters:
Content type specific search:
Source identification only:
When to Use This
Use when you need detailed content from multiple sources
Use for comprehensive research on complex topics
Use when analyzing and comparing information across sources
Use for gathering supporting evidence or documentation
Use when you need the full context from web pages
Related Functionality
For quick topic exploration without content, use the search summaries functionality
When you have a specific URL to extract, use the single page content extraction functionality
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| limit | No | ||
| include_content | No | ||
| max_content_length | No | ||
| top_n | No | ||
| recency_days | No | ||
| source | No | ||
| language | No | ||
| country | No |
Implementation Reference
- features/web_search/tool.py:26-98 (handler)The primary handler function for the MCP tool 'full_web_search'. Registered via @mcp.tool() decorator within the register_tool function. Handles parameters, invokes WebSearchService, formats search results into MCP-compatible text content.@mcp.tool() @inject_docstring(lambda: load_instruction("instructions.md", __file__)) async def full_web_search( query: str, limit: int = 5, include_content: bool = True, max_content_length: int = None, 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]: """Comprehensive web search with full content extraction""" 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 full_web_search: query='{query}', limit={actual_limit}") result = await web_search_service.search_and_extract( query=query, limit=min(actual_limit, 10), # Cap at 10 max_content_length=max_content_length, include_content=include_content, **search_params # Pass all supported parameters to service ) # Format for MCP response response_text = f"Search completed for '{result['query']}' with {result['total_results']} results:\n\n" for i, search_result in enumerate(result['results'], 1): response_text += f"**{i}. {search_result['title']}**\n" response_text += f"URL: {search_result['url']}\n" response_text += f"Description: {search_result['description']}\n" if search_result.get('full_content'): content = search_result['full_content'] if max_content_length and len(content) > max_content_length: content = content[:max_content_length] + f"\n\n[Content truncated at {max_content_length} characters]" response_text += f"\n**Full Content:**\n{content}\n" elif search_result.get('content_preview'): response_text += f"\n**Content Preview:**\n{search_result['content_preview']}\n" elif search_result.get('fetch_status') == 'error': response_text += f"\n**Content Extraction Failed:** {search_result.get('error', 'Unknown error')}\n" response_text += "\n---\n\n" logger.info(f"MCP tool full_web_search completed: {result['total_results']} results") return { "content": [{"type": "text", "text": response_text}] } except Exception as e: logger.error(f"MCP tool full_web_search error: {e}") raise
- features/web_search/service.py:64-81 (helper)Core helper method in WebSearchService that performs multi-engine web search and optional content extraction, called directly by the tool handler.async def search_and_extract(self, query: str, limit: int = 5, max_content_length: Optional[int] = None, include_content: bool = True, **kwargs) -> Dict[str, Any]: """Full web search with content extraction""" logger.info(f"Starting comprehensive web search for: '{query}' with parameters: {kwargs}") results = await self._multi_engine_search(query, limit, **kwargs) # Extract full content concurrently if requested if include_content: await self._extract_content_concurrent(results, max_content_length) return { "query": query, "results": [self._result_to_dict(r) for r in results], "total_results": len(results), "status": "success" }
- features/web_search/tool.py:17-25 (registration)The register_tool function that defines and registers the full_web_search tool (and others) with the FastMCP server instance.def register_tool(mcp: FastMCP, web_search_service: WebSearchService) -> None: """ Register web search tools with the MCP server Args: mcp: FastMCP server instance web_search_service: WebSearchService instance """