search_browser_history
Search browser history data to find specific URLs and titles matching your query terms for analysis and reporting.
Instructions
Search browser history for specific queries. Use this after getting history data.
Args:
query: Search term to look for in URLs and titles
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Implementation Reference
- server/main.py:82-89 (registration)MCP registration of the 'search_browser_history' tool. Provides the tool schema via signature and docstring, acts as a thin wrapper calling the core implementation.@mcp.tool() async def search_browser_history(query: str) -> List[HistoryEntryDict]: """Search browser history for specific queries. Use this after getting history data. Args: query: Search term to look for in URLs and titles """ return await tool_search_browser_history(query, CACHED_HISTORY)
- server/browser_utils.py:637-655 (handler)Core handler logic: Ensures history is loaded (cached or fetches fresh 7-day history), performs case-insensitive substring matching on entry URLs and titles, returns matching HistoryEntryDict objects.async def tool_search_browser_history(query: str, CACHED_HISTORY: CachedHistory) -> List[HistoryEntryDict]: if not CACHED_HISTORY.has_history(): history = await tool_get_browser_history(7, CACHED_HISTORY, "", True) else: history = CACHED_HISTORY.get_history() query_lower = query.lower() results = [] for entry in history: url = entry.get('url', '') title = entry.get('title', '') # Handle None values safely if (isinstance(url, str) and query_lower in url.lower()) or \ (isinstance(title, str) and query_lower in title.lower()): results.append(entry) return results