INNER CODE UNIT · Python
search_web
tiliondev/fortress · mcp/server.py:290
async def search_web(query: str, count: int = 10) -> dict:
"""Run a web search through a real stealth browser (not a paid SERP API) and
return organic results. Useful when you need fresh search results and SERP
APIs are unavailable or the search engine blocks scripted queries.
Returns {engine, query, results:[{title, url, snippet}...]}.
"""
count = max(1, min(int(count), 50))
t = await _t()
return await t.search(query, count=count)
@mcp.tool(annotations=_READ)
@_safe
async def extract_page(url: str, schema: dict | None = None) -> dict:
"""Extract clean, LLM-ready content from a page that may be behind bot
detection — returns markdown + tables + metadata (or a schema-shaped record if
`schema` is given). Use instead of raw HTML scraping when you want structured,